C# 如何访问另一个数据网格内部的子数据网格,在它之前';它没有装订
我有一个嵌套的数据网格。我想得到子datagrid的头文本,在绑定过程中 有什么方法可以做到这一点吗?您可以连接到。在这里,您可以为嵌套的数据网格C# 如何访问另一个数据网格内部的子数据网格,在它之前';它没有装订,c#,asp.net,datagrid,C#,Asp.net,Datagrid,我有一个嵌套的数据网格。我想得到子datagrid的头文本,在绑定过程中 有什么方法可以做到这一点吗?您可以连接到。在这里,您可以为嵌套的数据网格FindControl(),并动态绑定它 protected void DataGrid1_ItemDataBound(object sender, DataGridItemEventArgs e) { DataGrid child = e.Item.FindControl("theNestedGrid") as DataGrid; i
FindControl()
,并动态绑定它
protected void DataGrid1_ItemDataBound(object sender, DataGridItemEventArgs e)
{
DataGrid child = e.Item.FindControl("theNestedGrid") as DataGrid;
if(child != null)
{
// Binding logic here
}
}