I
ITnerd
The following code works to hide specific columns before they are bound to a
datagrid that has "autogeneratecolumns=true"
enabled. My question is: is there any way to do the same from a bindable
user defined collection? I have a "message" class that I don't want to have
to
munge into a DataTable to get the desired effect.
public void Item_Bound(Object sender, DataGridItemEventArgs e)
{
DataTable dt = MyDataGrid.DataSource as DataTable;
DataColumnCollection dc = dt.Columns;
e.Item.Cells[dc.IndexOf(dc["MessageText"])].Visible = false;
}
Thanks in advance.
datagrid that has "autogeneratecolumns=true"
enabled. My question is: is there any way to do the same from a bindable
user defined collection? I have a "message" class that I don't want to have
to
munge into a DataTable to get the desired effect.
public void Item_Bound(Object sender, DataGridItemEventArgs e)
{
DataTable dt = MyDataGrid.DataSource as DataTable;
DataColumnCollection dc = dt.Columns;
e.Item.Cells[dc.IndexOf(dc["MessageText"])].Visible = false;
}
Thanks in advance.