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

How to set Checkbox state based on database Bit field

2 Answers 394 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ida
Top achievements
Rank 1
Ida asked on 14 Oct 2013, 03:53 PM

Hi,

I have a checkbox set up as such:

<

 

 

telerik:GridCheckBoxColumn DataField="HaulSampledTrueFalse" HeaderText="Haul Sampled?" Visible="false" UniqueName="HaulSampledTrueFalse" EditFormColumnIndex="1"></telerik:GridCheckBoxColumn>

Could someone please advise how to set the state of the checkbox to "ticked" if the data field that the checkbox is bound to, is True.

Thanks, Ida

 

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 15 Oct 2013, 04:08 AM
Hi Ida,

GridCheckBoxColumn displays a check box to represent a Boolean value. Bind this column type to a Boolean field by setting its DataField property. If this column type is bound to a data value that is not Boolean, the grid throws an exception.
When the grid is in browser mode, or if the column is read-only, the check box is disabled. When the column is editable, the check box is enabled.
By default it shows the checkbox to be ticked, if the value in the database is True.

Thanks,
Princy
0
Ida
Top achievements
Rank 1
answered on 15 Oct 2013, 08:27 AM
Thanks Princy - that's worked!

Regards, Ida
Tags
Grid
Asked by
Ida
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Ida
Top achievements
Rank 1
Share this question
or