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
125
Binding to a List<MyObject>
posted

Hi,

 When I set the datasource property of my webgrid to a List<MyObject>, define columns with IsBound="false" and call databind, everything is ok, except for one thing: I get extra columns for all properties of MyObject. How can I make sure this doesn't happen?

Does something have an AutoGenerateColumns property?

 Thanks.

Parents
No Data
Reply
  • 440
    Verified Answer
    posted

    Thanks for the code. I was able to bind the list to my dropdownlist column. I used the overloaded UltraGridColumn.ValueList.DataBind(dataSource, dataMember, displayMember, valueMember) method call and it works. The dataMember is the valueMember.

    If you assign a list to a UltraWebGrid and you do not want the grid format change automatically according to the DataSource, you have to set the AutoGenerateColumns property to false and it is under the DisplayLayout property.

Children
No Data