Format boolean of datagrid item

desmondtan

Freshman
Joined
Dec 24, 2002
Messages
40
In my datagrid , there is a column display the boolean data from database filed ( True/False) .

Instaed of True/False, I would like to format the boolean data to Yes/No or checkbox . How to implent this function ?
 
You can use the CheckBox column type or control. I'm not exactly sure how to set this up from here (don't have .NET installed on this machine), but I can help in the morning if you can't get it.

As far as displaying True/False, Yes/No, or anything custom, I've always done the conversion in my query (or stored proc for SQL Server). It seems easier, and using a UDF in SQL Server means changing the text is fairly easy.

-Ner
 
I have accomplished this within the select clause that populates the datagrid. Add something like this to your select clause:
SELECT cmsTotalScore,
CASE cmsEmSent
WHEN 1 THEN 'Yes'
WHEN 0 THEN 'No'
END AS Sent
FROM cmscores

Add Sent to the column required in the datagrid
 
Back
Top