473,387 Members | 1,398 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Binding data to object and its nested object (ASP.NET 2.0)

Hi all.

I have a web app, in which I have object A. Object A has some
properties plus it holds instance of object B.

I bound object A to FormView - all its properties are properly
displayed. However there is a problem with displaying properties of
object B. Is there some way to bind labels to ObjectA.ObjectB.Property?
Or do I have to make another FormView?

Thanks in advance,
Piotrek.

Aug 3 '06 #1
4 3190
Hi
in the label's text set the value as
'<%=DataBinder.Eval(CType(CType(Container, DataListItem).DataItem,
ObjectA).ObjectB, "ObjectB_Property")%>'
--
---------------------------
Thanks,
Ibrahim

Software Consultant - Web Development, GB
"Piotrek" wrote:
Hi all.

I have a web app, in which I have object A. Object A has some
properties plus it holds instance of object B.

I bound object A to FormView - all its properties are properly
displayed. However there is a problem with displaying properties of
object B. Is there some way to bind labels to ObjectA.ObjectB.Property?
Or do I have to make another FormView?

Thanks in advance,
Piotrek.

Aug 3 '06 #2
Have to use formview instead of datalist in the above post
--
---------------------------
Thanks,
Ibrahim

Software Consultant - Web Development, GB
"Piotrek" wrote:
Hi all.

I have a web app, in which I have object A. Object A has some
properties plus it holds instance of object B.

I bound object A to FormView - all its properties are properly
displayed. However there is a problem with displaying properties of
object B. Is there some way to bind labels to ObjectA.ObjectB.Property?
Or do I have to make another FormView?

Thanks in advance,
Piotrek.

Aug 3 '06 #3
Piotrus,
Juz dziala wszystko?
Patrick
"Piotrek" <pt*********@poczta.fmwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
Hi all.

I have a web app, in which I have object A. Object A has some
properties plus it holds instance of object B.

I bound object A to FormView - all its properties are properly
displayed. However there is a problem with displaying properties of
object B. Is there some way to bind labels to ObjectA.ObjectB.Property?
Or do I have to make another FormView?

Thanks in advance,
Piotrek.

Aug 3 '06 #4
Hi, thanks for answers.

I know that Eval works. However I need 2-way databinding and Eval is
designed for 1-way.

Piotrek.

Aug 4 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ann Morris | last post by:
INTRODUCTION One of the most powerful aspects of .NET and Windows Forms is data binding. Data binding is the process of associating user interface (UI) elements with a data source to generate a...
0
by: kaborka | last post by:
I've used the Designer to create a strongly typed Dataset class from a stored procedure definition. I called this class cMyDSraw, and the table within it is called MyTable. The Designer...
2
by: Stephen Miller | last post by:
I am using the OnItemDataBound event of Repeater control to nest a DataGrid within the Repeater. When I attempt to bind to the DataGrid using the DataSource method I get the error message "Object...
3
by: bbernieb | last post by:
Hi, All, Is it possible to access a variable inside of a data binding, without the variable being out of scope? (Note: On the DataBinder line, I get an error message that says "Name 'i' is...
4
by: Alan Silver | last post by:
Hello, I'm trying to use an ArrayList to do data binding, but am getting an error I don't understand. I posted this in another thread, but that was all confused with various other problems,...
19
by: Simon Verona | last post by:
I'm not sure if I'm going down the correct route... I have a class which exposes a number of properties of an object (in this case the object represents a customer). Can I then use this...
1
by: Chris | last post by:
If I have an object I can store an array of objects with in it to model a collection. For example I could have a customer object, which has an array of invoice objects. How would I go about binding...
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
8
by: =?Utf-8?B?QXNo?= | last post by:
Hi, I have an object, for example User. User contains various properties which i have been able to bind to successfully using wizards and the form view. However if the class User has a property...
3
by: RobertTheProgrammer | last post by:
Hi folks, I've got another problem. Basically, I'm trying to use a nested GridView, however the nexted GridView displays no values (even though in debug I'm getting valid values into my DataSet. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.