This question is locked. New answers and comments are not allowed.
Hi,
I have a grid hiarchy as follows:
Categories
.....Products
..........Order Details
Each table has exactly one row. Initially all colums are set to:
col.IsVisible = false
I call the function below to show a particular column. In the Categories column I can show all columns. In Product and Order Details I can only show one column even though I am setting the col.IsVisible = true to other columns in the row.
Thanks
Rich;
I have a grid hiarchy as follows:
Categories
.....Products
..........Order Details
Each table has exactly one row. Initially all colums are set to:
col.IsVisible = false
I call the function below to show a particular column. In the Categories column I can show all columns. In Product and Order Details I can only show one column even though I am setting the col.IsVisible = true to other columns in the row.
Thanks
Rich;
public static void ShowGridColumn(RadGridView grid, String columnName)
{
IEnumerable<
GridViewRow
> rows =
grid.ChildrenOfType<
GridViewRow
>().Where(s => s.Item != null);
foreach (GridViewRow row in rows)
{
var dataControl = row.GridViewDataControl;
foreach (GridViewColumn col in dataControl.Columns)
{
if (col.UniqueName == columnName)
{
col.IsVisible = true;
return;
}
}
}
}