N
Nevyn Twyll
I have a multi-level datalist setup:
DataList1
DataList2
MyGrid
I have columns explicitly defined for the grid in the html.
Sometimes, On the initial Load() of the Page, I want to add extra columns to
the datagrid - for all records.
I tried getting a reference to the datagrid like this:
foreach(Control ctrl in this.DataList1.Controls)
{
if (ctrl.ID == "DataList2")
{
DataList2 = (DataList) ctrl;
break;
}
}
DataGrid MyGrid;
foreach(Control ctrl in dlstClasses.Controls)
{
if (ctrl.ID == "MyGrid")
{
MyGrid= (DataGrid) ctrl;
break;
}
}
But the inner DataList2 isn't found in the controls set of DataList1, and so
MyGrid isn't found inside DataList2, of course.
So how do I make those changes to the datagrid? Help?
DataList1
DataList2
MyGrid
I have columns explicitly defined for the grid in the html.
Sometimes, On the initial Load() of the Page, I want to add extra columns to
the datagrid - for all records.
I tried getting a reference to the datagrid like this:
foreach(Control ctrl in this.DataList1.Controls)
{
if (ctrl.ID == "DataList2")
{
DataList2 = (DataList) ctrl;
break;
}
}
DataGrid MyGrid;
foreach(Control ctrl in dlstClasses.Controls)
{
if (ctrl.ID == "MyGrid")
{
MyGrid= (DataGrid) ctrl;
break;
}
}
But the inner DataList2 isn't found in the controls set of DataList1, and so
MyGrid isn't found inside DataList2, of course.
So how do I make those changes to the datagrid? Help?