views:

24

answers:

1

I have a nested datagrid. I want to get header texts of child datagrid, bifore binding process.

Is there a way to do this?

A: 

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
    }
}
Greg B