This is a migrated thread and some comments may be shown as answers.

Convert from smallint (from datatable) to grid checkbox column

4 Answers 267 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Technology
Top achievements
Rank 1
Technology asked on 01 Dec 2010, 04:05 PM
Dear Telerik team,

i have a datatable (from SQL) column "enable" with data type smallint. The values of this column are "0" & "1".
The grid, shows the rows of this column like "0" & "1".
I want to change this column to CheckboxColumn and when the value is 0=unchecked and 1=checked.

How can i do that??
Thank you in advance for your help.

Best Regards,
Navarino Technology Department

4 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 01 Dec 2010, 04:31 PM
Helo technology,

If you are creating the columns manually, you can just follow this documentation. Otherwise, if you have auto generated columns, I personally would change my SQL to output a boolean value rather than a tinyint. The RadGeridView will automatically pick this up and change the editor to a checkbox in this case.

Hope that helps, but let me know if you need more information.
Richard
0
Richard Slade
Top achievements
Rank 2
answered on 01 Dec 2010, 04:34 PM
And another example for you in this forum link
0
Technology
Top achievements
Rank 1
answered on 01 Dec 2010, 04:48 PM
Thank you for your quick support.
I changed the SQL data type from tinyint to bit and the grid shows the column as checkbox.
0
Richard Slade
Top achievements
Rank 2
answered on 01 Dec 2010, 04:49 PM
Glad that helped.
All the best
Richard
Tags
GridView
Asked by
Technology
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Technology
Top achievements
Rank 1
Share this question
or