2010-02-12 67 views
1

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

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

问题是我不知道如何访问扩展详细信息行中的自定义控件。我没有看到网格上的任何Row或Items属性,这些属性将与FindControl()一起使用。 任何人都知道如何获得细节行甚至行对象?

谢谢!

回答

4

试试这个:

protected void grid_DetailRowExpandedChanged(object sender, ASPxGridViewDetailRowEventArgs e) 
if (e.Expanded) 
{ 
    YourControlType yourcontrol = (YourControlType)grid.FindDetailRowTemplateControl(e.VisibleIndex, "YourControlName") 
} 
+1

的作品就像一个魅力,谢谢! – 2010-02-13 16:53:32