|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Nested Properties in a GridView ASP.Net 2.0Hi.
I am using a GridView to display records from an ObjectDataSource. My middle-tier layer have nested properties, meaning that I have things like Employee.Name.FullName, where Employee is what I am binding the grid to while FullName is what I want displayed. For some reason the GridView does not allow me to do something like DataField="Name.FullName". This fine in a Windows Form DataGridView, but not in ASP.Net GridView! Is this a known issue? Are there any workarounds for it? Thanks in advance, Eyal. > I am using a GridView to display records from an ObjectDataSource. My Check out my blog at:> middle-tier layer have nested properties, meaning that I have things like > Employee.Name.FullName, where Employee is what I am binding the grid to > while FullName is what I want displayed. > > For some reason the GridView does not allow me to do something like > DataField="Name.FullName". This fine in a Windows Form DataGridView, but not > in ASP.Net GridView! > > Is this a known issue? Are there any workarounds for it? Thanks in advance, http://vaultofthoughts.net/UsingBindWithNestedProperties.aspx Where I describe how to deal with similar issues. Also check out my articles on problems with ObjectDataSource: http://vaultofthoughts.net/ProblemsWithObjectDataSource.aspx and a working alternative http://vaultofthoughts.net/ObjectDataSourceAWorkingAlternative.aspx or better yet with all other controls: http://vaultofthoughts.net/ASPNETControlsPack.aspx Of course, all feedback is always welcome. -- Michal Thank you Michal for the response. This is actually very similar to what we
have came up with. However, I do consider this solution a work around the problem (please take no offense as we have come up with the same idea). Do you (or anyone else) know if there are any plans for adding this functionality in a future version of the grid or perhaps in an "Atlas" CTP. Thank you again. Eyal. Show quoteHide quote "Mikeon" wrote: > > I am using a GridView to display records from an ObjectDataSource. My > > middle-tier layer have nested properties, meaning that I have things like > > Employee.Name.FullName, where Employee is what I am binding the grid to > > while FullName is what I want displayed. > > > > For some reason the GridView does not allow me to do something like > > DataField="Name.FullName". This fine in a Windows Form DataGridView, but not > > in ASP.Net GridView! > > > > Is this a known issue? Are there any workarounds for it? Thanks in advance, > > Check out my blog at: > http://vaultofthoughts.net/UsingBindWithNestedProperties.aspx > > Where I describe how to deal with similar issues. > > Also check out my articles on problems with ObjectDataSource: > http://vaultofthoughts.net/ProblemsWithObjectDataSource.aspx > > and a working alternative > http://vaultofthoughts.net/ObjectDataSourceAWorkingAlternative.aspx > or better yet with all other controls: > http://vaultofthoughts.net/ASPNETControlsPack.aspx > > Of course, all feedback is always welcome. > > -- > Michal > > > Thank you Michal for the response. This is actually very similar to what we I do not think they will do it soon. This is not a problem with a grid.> have came up with. However, I do consider this solution a work around the > problem (please take no offense as we have come up with the same idea). Do > you (or anyone else) know if there are any plans for adding this > functionality in a future version of the grid or perhaps in an "Atlas" CTP. It is a problem with how Bind works. When Bind retrievs data from a data-bound field it takes the string representation and transforms it to your destination type. With nested object it would be very difficult to do it. -- Michal
SelectedNode wrong when SelectedNodeChanged event fires
Convert a Checkbox value to text in a Formview item template Validation of 2 Textboxes Table cell with images Table cell .Net 2.0: Button, OnClientClick, and Click EventHandler not all working nicely... Dynamically Populate Web Page Values bug of UniqueID property dynamic popup menu Referencing User Control from ASPX page??? |
|||||||||||||||||||||||