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

dev 控件中点击TreeList节点高亮显示GridControl中存在的行

时间:2020-11-26 14:52:49      阅读:5      评论:0      收藏:0      [点我收藏+]

标签:control   hang   row   点击   存在   ups   控件   nta   优先级   

        private void treeListDs_FocusedNodeChanged(object sender, FocusedNodeChangedEventArgs e)
        {
            treeListDsNode = e.Node;
            string v = e.Node.GetValue("GROUP_RULE").ToString();
            DataTable dtGroups = gridLookUpEdit1.Properties.DataSource as DataTable;
            foreach(DataRow dr in dtGroups.Rows)
            {
                if (dr["RULE_GROUP"].ToString().Equals(v))
                    gridLookUpEdit1.EditValue = v;
            }
            gridViewGroupRule.Focus();
            gridViewGroupRule.LayoutChanged();
            //gridControlGroupRule.Focus();
        }
        private void GridViewGroupRule_RowStyle(object sender, RowStyleEventArgs e)
        {
            try
            {
                GridView View = sender as GridView;
                if (e.RowHandle >= 0)
                {
                    string category = View.GetRowCellDisplayText(e.RowHandle, View.Columns["RULE_CODE"]);
                    string v = treeListDsNode.GetValue("GROUP_RULE").ToString();
                    if (category == v)
                    {
                        e.Appearance.BackColor = Color.Salmon;
                        e.Appearance.BackColor2 = Color.SeaShell;
                        // 高优先级
                        e.HighPriority = true;
                        // 默认开启
                        // gridViewGroupRule.OptionsBehavior.SmartVertScrollBar = true;
                    }
                }
            }
            catch(Exception ex)
            {
                XtraMessageBox.Show(ex.Message);
            }
        }

dev 控件中点击TreeList节点高亮显示GridControl中存在的行

标签:control   hang   row   点击   存在   ups   控件   nta   优先级   

原文地址:https://www.cnblogs.com/jsersudo/p/14022776.html

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