Hello,
I'm trying to bind a DataSet to a grid containg colunms generated at runtime. This is what I'm doing:
First I set DisplayLayout.AutGenerateColumns = false
UltraWebGrid1.Bands[0].Columns.Clear();
gridColumn.Key = "FirstName";
gridColumn.Header.Caption = "First Name";
UltraWebGrid1.Bands[0].Columns.Add(gridColumn);
Then I call the DataBind() method on my grid.
In the DataBinding event handler I set the datasource:
UltraWebGrid1.DataSource = generateDataSet();
The generateDataset() method returns a DataSet with one DataTable containing 20 DataRows with only one column called "FirstName", which is a string. I'm setting the value of each column on each row to some sample names.
When the grid is rendered I can see there are 20 rows, but there's nothing inside de cells.
I placed some code inside the InitializeRow event handler, and I can see that the UltraGridRow objects have null content on the cell. The e.Data property contains the DataRow, and I can see the value of the FirstName column is not null.
What I'm I missing? Maybe the DataBind() method only works for columns where the IsBound property = true?
Any help is greatly appreciated.
Thanks
Please disregard my post. I know what was wrong. I was missing the UltraGridColumn.BaseColumnName property. I found the answer after reading this thread:
http://forums.infragistics.com/forums/t/1570.aspx
Thanks.