?
Solved

ASP Boundfield Datafield pointed to an object

Posted on 2009-05-15
3
Medium Priority
?
1,246 Views
Last Modified: 2012-05-07
I have gridview with an ASP Boundfield that is tied to a collection of objects.  if I set the datafield property to a property of the object, it works perfectly.  However, one of the properties of the object is another object and I need to set the datafield to a property of that second object.  how can I do that?  I tried Datafield="Obj2.Propertyname" where Obj2 is the name of the property of the main object.
0
Comment
Question by:jfb1126
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 19

Expert Comment

by:daveamour
ID: 24401503
If you are in control of the code you could introduce a new property to your 1st object which under the hood - ie in the getter retrieves the property value of the 2nd object - so a kind of proxy property designed to fulfill the limitations of the Gridview.
0
 

Author Comment

by:jfb1126
ID: 24412319
Thanks daveamour,  I thought about that.  if push comes to shove, I could get that code it the main object, but I was hoping for something on the front end before I have to  jump through those hoops.  :P
0
 

Accepted Solution

by:
jfb1126 earned 0 total points
ID: 24520315
What I did was create a template field with an item template of a label, then on Data Binding I was able to populate the field.

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question