DEV控件Grid的显示行号需要通过一个事件来设置,具体设置代码为:
private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { if (e.Info.IsRowIndicator && e.RowHandle >= 0) { e.Info.DisplayText = Convert.ToString(e.RowHandle + 1); } }
若行号显示不全,可设置gridview中indicatorWidth属性值的大小
时间: 2024-12-26 20:20:52