1

我尝试在 DevExpress 网格详细信息行中有自定义控件。每当展开一行时,我想将数据加载到基于 Masters Key 的那些自定义控件中。我正在使用 detailrow 扩展方法。

protected void grid_DetailRowExpandedChanged(object sender, ASPxGridViewDetailRowEventArgs e)
    if (e.Expanded)
    {
        int id = Convert.ToInt32(grd.GetRowValues(e.VisibleIndex, "ID"));
        ...
    }

问题是我不知道如何访问扩展详细信息行中的自定义控件。我在网格上看不到任何 Row 或 Items 属性,这些属性本来可以使用 FindControl()。有人知道如何获取详细信息行甚至是行对象吗?

谢谢!

4

1 回答 1

5

试试这个:

protected void grid_DetailRowExpandedChanged(object sender, ASPxGridViewDetailRowEventArgs e)   
if (e.Expanded)   
{   
    YourControlType yourcontrol = (YourControlType)grid.FindDetailRowTemplateControl(e.VisibleIndex, "YourControlName")
}   
于 2010-02-12T19:01:41.280 回答