码迷,mamicode.com
首页 > 其他好文 > 详细

DEV GridView快速定位到指定行

时间:2020-04-23 12:10:14      阅读:253      评论:0      收藏:0      [点我收藏+]

标签:指定   index   code   sea   master   grid   col   filter   int   

       int focuseHandle = gv.FocusedRowHandle;
            GridColumn column = gv.Columns["plan_id"];
            if (column != null)
            {
                if (focuseHandle >= 0)
                {
                    var topRow = gv.GetRow(topHandle) as grid_data; ;
                    var fRow = gv.GetRow(focuseHandle) as grid_data;
                    gc.DataSource = data;
                    gv.FindFilterText = btn_Search.Text;
                    int newTopRow = gv.LocateByValue(0, column, topRow.plan_id);
                    if (newTopRow != GridControl.InvalidRowHandle)
                        gv.TopRowIndex = newTopRow;

                    focuseIndex = gv.LocateByValue(0, column, fRow.plan_id);
                    if (focuseIndex != GridControl.InvalidRowHandle)
                    {
                        gv.FocusedRowHandle = focuseIndex;
                        gv.SetMasterRowExpanded(focuseIndex, true);
                    }
                }

 

DEV GridView快速定位到指定行

标签:指定   index   code   sea   master   grid   col   filter   int   

原文地址:https://www.cnblogs.com/wangpenghan/p/12759559.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!