Add a checkbox column to the briskdatagrid

Source: Internet
Author: User

Add a checkbox column to the briskdatagrid

After a checkbox column is added to the briskdatagrid, each cell in the column is displayed as a checkbox. To add a datagridcheckboxcolumn like a briskdatagrid, you must first declare a datagridcheckboxcolumn object. Then, use the addcheckboxcolumn () method of the briskdatagrid to add the object to the briskdatagrid. The following is a prototype of the addcheckboxcolumn () method:

Public sub addcheckboxcolumn (_

Byval checkboxcolumn as datagridcheckboxcolumn ,_

Byval mappingname as string ,_

Optional byval headertext as string = "",_

Optional byval [readonly] as Boolean = false ,_

Optional byval width as integer = 75 ,_

Optional byval allownull as Boolean = false ,_

Optional byval truevalue as object = true ,_

Optional byval falsevalue as object = false)

Checkboxcolumn

This parameter requires a datagridcheckboxcolumn object, which is the checkbox column to be added to the briskdatagrid.

Mappingname

This parameter accepts a string. The name of the data member mapped to the checkbox column.

Headertext

This parameter accepts a string. This string is used to set the text of the column header. This parameter is an optional parameter. The default value is "".

Readonly

This parameter accepts a Boolean value. This value determines whether the column is read-only. True, read-only; false, not read-only. This parameter is an optional parameter. The default value is false.

Width

This parameter accepts an integer to determine the column width. Optional. The default value is 75.

Allownull

This parameter accepts a Boolean value to determine whether the column can accept null values. True: NULL values can be accepted. False: NULL values cannot be accepted. This parameter is an optional parameter. The default value is false.

Truevalue

This parameter accepts an object to determine the actual value used when the column value is set to true. This parameter is an optional parameter. The default value is true.

Falsevalue

This parameter accepts an object to determine the actual value used when the column value is set to false. This parameter is an optional parameter. The default value is false.

The following program snippet shows how to add a checkbox column to the briskdatagrid:

Private sub initbriskdatagrid ()

Dim dvemployee as new dataview (Me. dshr. Tables ("employees "))

Me. briskdatagrid. setdatabinding (dvemployee)

Me. briskdatagrid. begintablestyle ("employees ")

Dim colsingle as new datagridcheckboxcolumn

Me. briskdatagrid. addcheckboxcolumn (colsingle, "emp_single", "single ")

Me. briskdatagrid. endtablestyle ()

End sub

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.