开发者

ASPxGridView -Custom Controls in DetailRow

开发者 https://www.devze.com 2022-12-20 12:07 出处:网络
I try to have custom controls in a DevExpress grids detail row. When ever a row is expanded I would like to load data into those custom controls based on the Masters Key.

I try to have custom controls in a DevExpress grids detail row. When ever a row is expanded I would like to load data into those custom controls based on the Masters Key. I am using the detailrow expended method.

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

The problem is I don't know how to access the custom controls in the expended detail row. I don't see any Row or Items properties 开发者_如何学运维on the grid, which would have been with a FindControl(). Any one got a clue on how to get the detail row or even a row object?

Thanks!


Try this:

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

精彩评论

暂无评论...
验证码 换一张
取 消