开发者论坛

 找回密码
 注册 (请使用非IE浏览器)
查看: 3118|回复: 0

GridControl的Master-detail动态加载detail数据,出现2次调用服务

[复制链接]

0

精华

0

贡献

0

赞扬

帖子
14
软币
115
在线时间
6 小时
注册时间
2015-1-23
发表于 2015-3-26 14:23:09 | 显示全部楼层 |阅读模式
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窗口进行排序
救解

回复

使用道具 举报

Archiver|手机版|小黑屋|开发者网 ( 苏ICP备08004430号-2 )
版权所有:南京韵文教育信息咨询有限公司

GMT+8, 2024-5-12 04:38

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表