Datagirdview Common Operations

Source: Internet
Author: User

1. Add a column of the data source to an existing irdview column.

For example, add all file names in the folder to the file name column of irdview, as shown in the following figure:

First, set the datapropertyname of the file name column to the name of the data column to be displayed in the datagridview.
Here I am bound to folder. Name, so simply enter name in datapropertyname.

Directoryinfo folder = new directoryinfo (txtpath. Text); dgvfilelist. autogeneratecolumns = false; dgvfilelist. datasource = folder. getfiles ("*. xls ");

2. assign values to a column of a row

Dgvfilelist. Rows [I]. cells ["cbresult"]. value = "wait ";

3. Check whether the checkbox of irdview is selected.

For (INT I = 0; I <datagridview1.rows. count; I ++) {If (bool) datagridview1.rows [I]. cell [0]. editedformattedvalue = true) {// todo }}

 

Datagirdview Common Operations

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.