C # attributes commonly used by the DataGridView in winform,

Source: Internet
Author: User

C # attributes commonly used by the DataGridView in winform,

1.AllowUserToAddRowsAttribute: Indicates whether to display the option of adding a row to the user.

AllowUserToOrderColumns attribute: Indicates whether to allow manual column relocating

AllowUserToResizeColumns attribute: indicates whether the user can adjust the column size

AllowUserToResizeRows attribute: indicates whether the row size can be adjusted.

2.ColumnHeadersVisibleAttribute: Indicates whether to display the column title row.

RowHeadersVisibleAttribute: Indicates whether to display a column containing the row title.

3.ReadOnlyAttribute: indicates whether the user can edit the cell of the dview control.

Enabled attribute: indicates whether the control is Enabled and whether the control can respond to user interaction.

4.AutoSizeColumnsModeAttribute: determines the automatic adjustment mode of visible Columns

AutoSizeRowsModeAttribute: determines the automatic adjustment mode of visible rows.

5.DefaultCellStyleAttribute: Default cell style (Alignment Mode,Foreground,Rear view,Font)

 ColumnHeadersDefaultCellStyleAttribute: Default style of the column title

 RowsDefaultCellStyleAttribute: Default row cell style

RowTemplate. DefaultCellStyle attribute: Default cell style of the row Template

AlternatingRowsDefaultCellStyle attribute: Default cell style for odd rows

6. MultiSelect attribute: Indicates whether to allow users to select multiple cells, rows, or columns of the DataGridView at a time.

SelectionMode attribute: indicates how to select the cells of the DataGridView.

7.StandardTabAttribute: Indicates whether to move the focus to the next control in the order of the Tab key, instead of moving the focus to the next cell in the control.

8. BackgroundColor attribute: gets and sets the background color of the DataGridView.

BorderStyle attribute: Get and set the border style of the DataGridView.

CellBorderStyle properties: Get and set the cell border Style

GridColorProperty: gets and sets the gridline color.

ScrollBars property: Type of the scroll bar to be displayed in the DataGridView Control

9. DataSource attribute: gets or sets the data source displayed in the DataGridView.

 DataMemberAttribute: indicates the Child list of DataSource to be displayed in the DataGridView control.

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.