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.
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.
I agree, it's not entirely obvious what you should do here. Set IsBound="true" on a column then set the BaseColumnName property to your object's field name and it will work. Setting IsBound="true" has the same effect whether you set it on one or more columns, so it seems odd that this isn't a property specified overall like AutoGenerateColumns is.
<igtbl:UltraGridColumn IsBound="true" BaseColumnName="MonthName"> <Header Caption="Year 2009" /></igtbl:UltraGridColumn>