zoukankan      html  css  js  c++  java
  • 解决gridview row 左边序列号 显示不完全的技巧

    放在主程序 入口处,

    public Form1()
            {
                InitializeComponent();
                gridView1.IndicatorWidth = 50; //<宽度值>官方推荐常用是30,至于多少自己根据自己的需求和喜好去修改宽度的大小。
    
            }

    则每次程序运行时都能正确完整的显示序列号。

    test

    附送2种方法。

    private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
            {
                e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                if (e.Info.IsRowIndicator)
                {
                    if (e.RowHandle >= 0)
                    {
                        e.Info.DisplayText = (e.RowHandle + 1).ToString();
                    }
                    else if (e.RowHandle < 0 && e.RowHandle > -1000)
                    {
                        e.Info.Appearance.BackColor = System.Drawing.Color.AntiqueWhite;
                        e.Info.DisplayText = "G" + e.RowHandle.ToString();
                    }
                }
                gridView1.IndicatorWidth = 60;
    
                #region MyRegion
                //if (e.Info.IsRowIndicator)
                //{
                //    e.Info.DisplayText = e.RowHandle.ToString();
                //}
                //gridView1.IndicatorWidth = 30; 
                #endregion
            }
  • 相关阅读:
    Count_sort C++
    Priority_Queue C++
    HeapSort C++
    Randomized_QuickSort C++
    QuickSort c++
    我的开发环境
    github and eclipse
    centos 7 install eclipse cdt and use github
    github commands
    文化-梁晓声
  • 原文地址:https://www.cnblogs.com/wordgao/p/4574700.html
Copyright © 2011-2022 走看看