GridControl的Master-detail动态加载detail数据,出现2次调用服务
GridView gv = gc.View;gv.MasterRowGetRelationCount += gv_MasterRowGetRelationCount;
gv.MasterRowGetRelationName += gv_MasterRowGetRelationName;
gv.MasterRowGetChildList += gv_MasterRowGetChildList;
gv.MasterRowEmpty += gv_MasterRowEmpty;
注册上述4个事件后,点击Gridcontrl某行的”+",会引发MasterRowGetChildList事件2次,造成向后台服务调用2次
private void gv_MasterRowGetChildList(object sender, MasterRowGetChildListEventArgs e)
{
if (e.RowHandle >= 0)
{
string tradeID = gc.View.GetRowCellValue(e.RowHandle, ResourceConst.TradeID).ToString();
if (!string.IsNullOrEmpty(tradeID))
{
e.ChildList = GetList(tradeID); //会向后台服务调用2次请求
}
}
}
(2)另外,对Master多行点击”+",打开了多个对于detailView后,对其中一个detailview的某个列头点击排序后,会造成,所有已打开的detailView,都进行排序。我只想对当击detailview窗口进行排序
救解
页:
[1]