DevExpress GridControl 显示行号

DevExpress GridControl 显示行号

 

//在GridView的CustomDrawRowIndicator事件中添加如下代码:



 private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)

  {

            if (e.Info.IsRowIndicator && e.RowHandle >= 0)

            {

                e.Info.DisplayText = e.RowHandle.ToString();

            }

}

//要调整行号列的宽度只需要调整gridview1.IndicatorWidth属性即可

你可能感兴趣的:(DevExpress)