• GridControl详解(五)设置行备注和行号


    备注显示设置

      设置备注字段

      显示结果:

      可以写入按键事件F3,用以开关备注显示

    1.     private void Form4_KeyUp(object sender, KeyEventArgs e)  
    2.         {  
    3.             if (e.KeyCode == Keys.F3)  
    4.             {  
    5.                 gridView1.OptionsView.ShowPreview = !gridView1.OptionsView.ShowPreview;  
    6.             }  
    7.         }  
        private void Form4_KeyUp(object sender, KeyEventArgs e)
            {
                if (e.KeyCode == Keys.F3)
                {
                    gridView1.OptionsView.ShowPreview = !gridView1.OptionsView.ShowPreview;
                }
            }
    

      行号显示要用到的事件:

      代码:

    1. private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)  
    2. {  
    3.     if (e.Info.IsRowIndicator)  
    4.     {  
    5.         e.Info.DisplayText = "Row " + e.RowHandle.ToString();                 
    6.     }  
    7. }  
    8. gridView1.IndicatorWidth = 70;  
    private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
    {
        if (e.Info.IsRowIndicator)
        {
            e.Info.DisplayText = "Row " + e.RowHandle.ToString();               
        }
    }
    gridView1.IndicatorWidth = 70;

      显示结果




  • 相关阅读:
    博客美化
    hello world
    mysql数据库索引
    Golang:线程 和 协程 的区别
    计算机网络详解
    Redis持久化机制
    nginx 详解
    多级缓存的分层架构
    svn忽略文件不提交至服务器的方法
    Mysql 事务及其原理
  • 原文地址:https://www.cnblogs.com/lteal/p/2836937.html
Copyright © 2020-2023  润新知