Solved

ASP Boundfield Datafield pointed to an object

Posted on 2009-05-15
3
1,232 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
  • 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

773 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