private void gridView_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { if (e.Info.IsRowIndicator && e.RowHandle >= 0) { e.Info.DisplayText = (e.RowHandle + 1).ToString(); } }
同时在load函数中加上这么一句:
gridView.IndicatorWidth = 40;显示效果如下:
小注:
如果上面两步都设置了,但还是不显示,请看一下gridview的属性中,这个地方是不是false?