Solve the problem that the serial number on the left of the gridview row is not completely displayed, gridviewrow

Source: Internet
Author: User

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        }

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.