Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > ASP.NET 2.0 - How to databind to nested (hierarchical) business objects?

Reply
Thread Tools

ASP.NET 2.0 - How to databind to nested (hierarchical) business objects?

 
 
style
Guest
Posts: n/a
 
      09-08-2006
Hi everybody

Is it somehow possible to databind a control to a nested business object in
ASP.NET 2.0?

Let's say I have a business object "User" with the properties "Name"
(string), "Age" (int) and "Place" whereas Place is a reference to another
business object of the type Location. The class Location has the properties
"ZipCode" (int) and "City" (string).

Now I can bind my control to Name and Age because these properties are
primitive data types. But I don't know how to bind it to the the City
property of the nested object Place.

Any ideas? Maybe .NET 2.0 has some other happy surprises I didn't know of
yet, f.e. something like Bind("Location.City")... : )

Kind regards
Thomas


 
Reply With Quote
 
 
 
 
Amar
Guest
Posts: n/a
 
      09-15-2006
Any luck on this?

Trying to do the same thing
 
Reply With Quote
 
 
 
 
style
Guest
Posts: n/a
 
      09-15-2006
No, I haven't found an answer yet. Anybody any ideas?

As a workaround I did the following... I am exposing the City (=property of
the nested Location class) in the User class as a property:

public string City
{
get
{
return myLocation.City;
}
}

Thus I can databind to the City property.

Kind regards
Thomas


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Problem: Nested Repeater won't databind()? Colin Nicholls ASP .Net 4 11-09-2009 08:18 AM
Business-to-Business Data Integration in a SOA World Stylus Studio XML 0 02-17-2006 05:07 PM
Business Opportunity - Start Your Own VoIP Telephony Service Provider Business ubifone VOIP 0 07-29-2005 07:55 PM
BUG in DataBind? After .DataBind there are more DataGrid Items than DataSet Rows! Michael ASP .Net Datagrid Control 0 12-29-2003 07:47 PM



Advertisments