Showing CheckBoxes on Grid Bound to ADODB.Recordset 
Author Message
 Showing CheckBoxes on Grid Bound to ADODB.Recordset

Hello to Everybody

A have a datagrid whose datasource is bound to an

The Source of the ADODB.Recordset is a SELECT statement
getting data from SQLServer2000.

I want a column to show a CheckBox, so I set Format
property for that column to CheckBox.

However, since SQLServer has no specific datatype for
Boolean (I'm using SQL DataType 'bit' for my boolean
fields), Datagrid is not displaying the data on the column
as checkbox, instead, it's just showing 1 or 0.

How do I force the grid to recognise bit values 1 or 0 as
true or false?

Many thanks

Mon, 18 Jul 2005 09:01:58 GMT  
 Showing CheckBoxes on Grid Bound to ADODB.Recordset

>-----Original Message-----
>The Checkbox dataformat merely changes the values coming

from SQL server (0 and -1) to 0 and 1. You can also set
the format to display True or False in the
>grid and then trap the Click in the cell to change the

value. Another option if you want Checkboxes is to use the
MSHFlexGrid (See the attached sample) and use
>the Wingdings font in the cell show a Checked and
Unchecked box...

>I couple of years ago I had a sample that 'floated'

checkboxes over the datagrid, but believe me, the amount
of code in so many events just to keep the
>checkbox array positioned properly wasn't worth the

>The other option is to look into third party grid

controls, many of them do support a Checkbox in the cells.

>Want to know more? Check out the MSDN Library at  or the Microsoft Knowledge Base

>Scot Rose, MCSD
>Microsoft Visual Basic Developer Support

from address>

>This posting is provided "AS IS", with no warranties, and
confers no rights.

Tue, 19 Jul 2005 11:39:06 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Binding The DataGrid With ADODB Recordset

2. Binding a MSFlexGrid to a ADODB.Recordset

3. Binding DataGrid to ADODB.recordset

4. data grid adodb.recordset

5. adodb recordset won't go into flex grid

6. Bind a recordset to my power point slide show

7. recordset to grid binding?

8. Update Recordset Bound to Grid

9. Binding the Data Grid to an empty Recordset displays a blank row

10. Please Help: Question about Grid bound to a recordset

11. Bind grid to recordset whith OraOLEDB Provider for ADO

12. Displaying ADO RecordSet in a Data Bound Grid?


Powered by phpBB® Forum Software