C # WinForm DataGridView Interface Design Tips

Source: Internet
Author: User

The table in the window is a very common form of data display, so the display of the interface is very important, through the use of many times to find The default display style of the C # WinForm DataGridView Control is very anti-human, but it's good to see a few simple property modifications in the visualization.

Here's a look at the DataGridView display of the default properties generated:

A very anti-human form.

Start by modifying the following properties that can be read by name (either through the VS Properties window or by manually modifying the DataGridView properties in the initialization code):

Allowusertoaddrows=false; // do not agree with the user to add rows, so that the last line of blank lines will not appear, most of the time the table is only used to display the data rather than the user input data (input data god horse in Excel more convenient bar)  Backgroundcolor=white; // The background color is set to white, at least more than the default gray lot better  Rowheadersvisible=false; // The outfit does not show, this is useful when you do not have to select a whole line of operation, because the display of the wardrobe is very counter-day

Now the effect:

Autosizecolumnsmode=fill; // the width of the list header is evenly distributed, filling the table space. This is a very critical step.

Final effect:

In my humble opinion, the purpose is to share and to record for future contingencies.

C # WinForm DataGridView Interface Design Tips

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.