VSFlexGrid Tutorials > Edit Demo > Step 3: Check Boxes |
When displaying boolean (True/False) values, you have the option of using check boxes instead of True/False strings or 1/0 values. This has the advantage of preventing users from entering bad values.
Column 4 (Bonus) contains boolean values (either someone gets a bonus or not). To display the values as checkboxes, set the ColDataType property to flexdtBoolean. The control will automatically display and manage the check boxes.
The ColDataType property must be assigned at runtime. Change the Form_Load routine as shown below:
Example Title |
Copy Code
|
---|---|
Private Sub Form_Load() ' format column 3 (Amount Sold) to display currency fg.ColFormat(3) = "$#,###.00" ' make column 4 (Bonus) a boolean column fg.ColDataType(4) = flexdtBoolean End Sub |
Users may toggle the check boxes by clicking them or by selecting them with the keyboard and then hitting enter or space. Press F5 to run the project again, then type a few sales amounts and give bonuses to some people.