GridViewWithSerialNum.cs 600 B

123456789101112131415161718192021
  1. using DevExpress.XtraGrid.Views.Grid;
  2. namespace UAS_DeviceMonitor.CustomerControl.GridViewWithSerialNum
  3. {
  4. public partial class GridViewWithSerialNum : GridView
  5. {
  6. public GridViewWithSerialNum()
  7. {
  8. InitializeComponent();
  9. IndicatorWidth = 30;
  10. }
  11. private void GridViewWithSerialNum_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
  12. {
  13. if (e.Info.IsRowIndicator && e.RowHandle >= 0)
  14. {
  15. e.Info.DisplayText = (e.RowHandle + 1).ToString();
  16. }
  17. }
  18. }
  19. }