Gridcontrol: checkedit of columnedit

Source: Internet
Author: User

This article from: http://www.cnblogs.com/Warriors/archive/2010/11/12/1875432.html

First of all, after this Singles' Day, I am a little cainiao and I sincerely hope you will get rid of this holiday as soon as possible.

Recently, gridcontrol is commonly used to develop some things. Many things are difficult to find at the beginning and cannot be found on the Internet, so I recorded what I occasionally understand, save some time for those who need it.
Well, it's cool, so I hope everyone can take it lightly when making bricks.

Sometimes we use the gridcontrol control instead of simply displaying data, when editing data, you sometimes have to read data from the background and then edit it based on the background data, one way is to set the columnedit of gridcontrol (similar to the datagridviewcheckboxcolumn in the DataGrid ). Let's talk about checkedit:

Currently, I have used multiple records in GC. When multiple records are selected, a column of columnedit is set to checkedit. The default value of existing is null. You can set the name after you select "new. In the figure, the column gdcol_xz is set to checkedit.

 

After the interface is completed, data is bound. In fact, this part is not difficult. After checkxz is found in the GC designer, the attributes that need to be noted include valuechecked and valueunchecked, they correspond to the values of the cells in the column in the selected and unselected cases respectively. Simply put, valuechecked records the value bound to the cell when the checkedit is selected. What else can be said? Get it done!

Assume that your binding is set in this way. bsmain. datasource = This. dtmain; this. gclist. datasource = This. bsmain; the default value of valuechecked is Boolean true, and the value of valueunchecked is false. What should I do if the value of gdcol_xz column in dtmain is string? Easy: Call obejcteditor in valuechecked to change the value of type to string type value to the value recorded when dtmain is selected, here, I correspond to 1 (not passing the graph). Similarly, the valueunchecked setting and the data type in the corresponding column of dtmain. OK. The end is now.

 

If you make a brick, please be light. Thank you.

 

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.