Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
813
Binding Properties which is inside another Object Property
posted

I have a an Object(say objParent) one of the property of that Object return another Object (say objChild).

now I have an collection of objPatent which is need to be binded to the WebGrid.

I but two of the columns has to be binded with the propertied of objChild.

for all others I have set BaseColumnName as per objParent's public property and those are binding fine.

But how do I bind objChild's property to grid. Or what I should give BaseColumnName so it will take objChild's property to bind that column.

 

Thanks.

  • 21382
    posted
    The Grid will not bind to child properties off of an object. The only way that might work would be to add two unbound columns to the WebGrid, and in the InitializeRow event set the values for the cells in those columns to the values from your child object.