Solve the problem that the serial number on the left of the gridview row is not completely displayed, gridviewrow
At the entrance of the main program,
Public Form1 () {InitializeComponent (); gridView1.IndicatorWidth = 50; // <width> the official recommendation is usually 30. Modify the width according to your needs and preferences. }
The serial number is correctly and completely displayed each time the program runs.
Two methods are provided.
private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; if (e.Info.IsRowIndicator) { if (e.RowHandle >= 0) { e.Info.DisplayText = (e.RowHandle + 1).ToString(); } else if (e.RowHandle < 0 && e.RowHandle > -1000) { e.Info.Appearance.BackColor = System.Drawing.Color.AntiqueWhite; e.Info.DisplayText = "G" + e.RowHandle.ToString(); } } gridView1.IndicatorWidth = 60; #region MyRegion //if (e.Info.IsRowIndicator) //{ // e.Info.DisplayText = e.RowHandle.ToString(); //} //gridView1.IndicatorWidth = 30; #endregion }