Hi,
I am adding the columns to the grid at runtime and setting the header caption
BoundDataField boundcolumn = new BoundDataField(); boundcolumn.Key = attributes.ColumnName; boundcolumn.DataFieldName = attributes.ColumnName; boundcolumn.DataType = attributes.Datatype.ToString();
BoundDataField
boundcolumn = new BoundDataField(); boundcolumn.Key = attributes.ColumnName; boundcolumn.DataFieldName = attributes.ColumnName; boundcolumn.DataType = attributes.Datatype.ToString();
boundcolumn.Key = attributes.ColumnName;
boundcolumn.DataFieldName = attributes.ColumnName;
boundcolumn.DataType = attributes.Datatype.ToString();
In your code, you don't even set the header caption. And adding columns in the code behind should not present a problem. Could you attach a sample or more sample code that demonstrates the problem?
regards,David Young
Sorry for missing that code line . Here we go..... After any postback the headercaption is lost.....
BoundDataField boundcolumn = new BoundDataField(); boundcolumn.Key = attributes.ColumnName; boundcolumn.DataFieldName = attributes.ColumnName; boundcolumn.DataType = attributes.Datatype.ToString(); if (attributes.Hidden) boundcolumn.CssClass = "hideMyColumn"; boundcolumn.Header.Text = attributes.ColumnName; wdgGenericGrid.Columns.Add(boundcolumn);