And*_*ers 1 asp.net devexpress aspxgridview
我尝试在 DevExpress 网格详细信息行中使用自定义控件。当一行被扩展时,我想将数据加载到基于主键的自定义控件中。我正在使用detailrow expended 方法。
protected void grid_DetailRowExpandedChanged(object sender, ASPxGridViewDetailRowEventArgs e)
if (e.Expanded)
{
int id = Convert.ToInt32(grd.GetRowValues(e.VisibleIndex, "ID"));
...
}
Run Code Online (Sandbox Code Playgroud)
问题是我不知道如何访问扩展明细行中的自定义控件。我在网格上看不到任何 Row 或 Items 属性,而这些属性本来可以使用 FindControl()。有人知道如何获取详细信息行甚至行对象的线索吗?
谢谢!
尝试这个:
protected void grid_DetailRowExpandedChanged(object sender, ASPxGridViewDetailRowEventArgs e)
if (e.Expanded)
{
YourControlType yourcontrol = (YourControlType)grid.FindDetailRowTemplateControl(e.VisibleIndex, "YourControlName")
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7743 次 |
| 最近记录: |