1、设置显示编号的宽度

   IndicatorWidth设置成所适合大小

2、在CustomDrawRowIndicator事件中编写如下代码

  #region 设置行号

        private void gvUser_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
        {
            int rowIndex = e.RowHandle;
            if(rowIndex>=0)
            {
                 rowIndex++;
                e.Info.DisplayText = rowIndex.ToString();
            }
            e.Info.ImageIndex = -1;
        }

 #endregion

相关文章:

  • 2021-06-03
  • 2021-10-07
  • 2021-11-21
  • 2021-12-26
  • 2022-01-03
  • 2021-06-23
猜你喜欢
  • 2022-01-18
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2022-01-10
  • 2021-08-27
  • 2022-01-18
相关资源
相似解决方案