I have a nested datagrid. I want to get header texts of child datagrid, bifore binding process.
Is there a way to do this?
I have a nested datagrid. I want to get header texts of child datagrid, bifore binding process.
Is there a way to do this?
You can hook into the ItemDataBound
event. In here, you can FindControl()
for your nested DataGrid and bind that on the fly.
protected void DataGrid1_ItemDataBound(object sender, DataGridItemEventArgs e)
{
DataGrid child = e.Item.FindControl("theNestedGrid") as DataGrid;
if(child != null)
{
// Binding logic here
}
}