The column name of the datagridview control corresponds to the column name in the DataSet.

Source: Internet
Author: User

The column name of the datagridview control corresponds to the column name in the DataSet.

Select the DataGridView control, select Colums attribute items, and click to edit the columns of the DataGridView control. You can add multiple column items in the column Editor, where HeadText in the column attribute is displayed externally, that is, the Name is used to Name the column object, and DataPropertyName is used to specify the column to which the data source is bound, this column attribute can bind the specified data to the column in The DataGridView. Specifically, you only need to specify the attribute of the DataPropertyName column as a column name of the data source. For example, a column in the data source is "UserName ", if the attribute of the DataPropertyName column is specified as "UserName", the data corresponding to the "UserName" column in the data source can be bound to the specified column in The DataGridView, it also binds the specified data column to the column in The DataGridView. You can specify the Column Display name with the column attribute HeadText.

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.