Print Page | Close Window

How to display related object properties in an ASP.Net GridView/DetailsView control

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=302
Printed Date: 04-Jun-2025 at 11:02am


Topic: How to display related object properties in an ASP.Net GridView/DetailsView control
Posted By: Customer
Subject: How to display related object properties in an ASP.Net GridView/DetailsView control
Date Posted: 16-Jul-2007 at 3:22pm

I've just spent the last couple of days reading the Concepts document and looking at some tutorials.

I still can't find anything which shows how to easily display related object properties in an ASP.Net GridView/DetailsView control. I mean, for example, where you retrieve a list of orders from the Orders table - you have foreign key fields in the table, such as CustomerId and EmployeeId. Those are meaningless, and naturally you want to display the Customer name, or the Employee.Fullname field rather than the Id column. 

Is there an easy way to do this? Do I have to create a custom property in the Order object, which shows the desired data? Even better would be to use something like "Bind('Order.Customer.Fullname')" in the declarative code for the GridView. I have no idea.

Could you throw some light on the subject? Is there a Funhouse Web ASP.Net application?




Replies:
Posted By: IdeaBlade
Date Posted: 16-Jul-2007 at 3:24pm

I have attached some sample code and a document that addresses the issue on how you do nested properties in a web form.

  http://www.ideablade.com/forum/uploads/20070716_195710_DevForceTypeDes.zip - uploads/20070716_195710_DevForceTypeDes.zip




Print Page | Close Window