Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I show a "Yes/No" field as a Check Box in a DataGrid?

Status
Not open for further replies.

bmj

Programmer
Aug 2, 2000
6
0
0
US
I am using a datagrid linked to an Access database via an ADO control. The database has a field that is "Yes/No". I need the datagrid to show a checkbox in this field. Any Suggestions?
 
Dear ,
The DataGrid does not have the Check box facility , but to achive this task you have to set a control array of check boxes at the time of filling the grid. As you do with text box to take inputs in a grid.
We are using third party ActiveX Sheridon UltraGrid ot Apex True DBGrid , which have check box funtionality.

I'll try to send the code also.

Regards ,
essa2000
 
No. I've done this before and let me look for my code !! Here it is:

Set VItems = TDBGrid1.Columns("Select").ValueItems
Vitem.Value = True
Vitem.DisplayValue = LoadPicture("CHKON2.BMP")
VItems.Add Vitem
Vitem.Value = False
Vitem.DisplayValue = LoadPicture("CHKOFF2.BMP")
VItems.Add Vitem
VItems.Translate = True
VItems.CycleOnClick = True

It involves bmp pictures of what you want to display, like an "X" or checkmark. You have to define the field in Access as Boolean and it cycles between true and false.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top