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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid check box property

Status
Not open for further replies.

ami7

Programmer
Oct 3, 2002
48
GB
hi,

Is there anyway to change the checked value to YES/No instead of true or false on a Datagrid Control.

When i populate my grid it displays the value for a cheked field to True/false.
i want that to be changed to YES/NO

pls help.

Rgds,
ami
 
no, it's a boolean property, which is true/false.

the only way around this would be to write a custom control and override the .checked property to return a string value of yes/no, where you'd be checking the true/false under the covers, and just returning the yes/no value based on that.
penny1.gif
penny1.gif
 
Can you provide me with an example for the same.

Thanks.
ami
 
you could also just hide the column that has the boolean value, add a template column next to it that is visible, and then just have a bit of code that rips through the grid, checks the value of the hidden column, and displays "Yes/No" in the template column.

I do a similar thing in a datagrid that I have checkboxes in, so that if they aren't editing the data a graphic with a check is shown instead.

D
 
Thanks for that info.

Could you pls provide me with some example.(code)

Rgds,
Ami.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top