The Repositoryitemcheckedit in DevExpress

Source: Internet
Author: User

DevExpress in the third-party control Library of the. NET platform should be relatively well-known. This control library is currently used by our project.

Currently involved in a development, to achieve a simple function, that is, in the list area to provide a selection box, so that users can achieve multiple choices.

Looked at the DevExpress forum, said very simple, if the bounded column, then the Columnedit attribute on its value of a repositoryitemcheckedit can be assigned.

But I do as required to do, the choice box can appear, but the dead or alive can not achieve multiple selection. Find a number of data, try a number of methods, such as a virtual increase in the database acquisition of a column, select 1 as selected ..., such as Optionsselection.multiselect = True, all these, can not be changed to achieve multiple selection.

What's the final solution? The original is because we use Oracle, but Oracle does not have a bool type, so simply do not add the column in the SELECT statement, and select after the DataTable passed to the foreground, after the assignment to DataGridView, manually add a column, as follows:

Data. Columns.Add ("SELECTED", typeof (System.Boolean));
for (int i = 0; i < data. Rows.Count; i++)
{
Data. rows[i]["SELECTED"] = false;
}

This ensures that the type of the column is bool and that each column is initialized to unchecked.

If it is SQL Server or another database, the database itself supports the bool type, then the direct SELECT statement, no such trouble.

The Repositoryitemcheckedit in DevExpress

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.