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

[Solved] Unsure how to display bool as checkbox in Grid

3 Answers 166 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Frank Michael
Top achievements
Rank 1
Frank Michael asked on 17 May 2010, 10:26 AM
In my Grid I am using client binding.
Be default bool is displayed as text "true" or "false".
I want it to be displayed as Checkbox.
I tried ClientTemplates for this. However in this case it is editable, which is undesireable.
It is editable, even though I did declare the column as readonly.
And also the values are not displayed in this case. Only all empty checkboxes.
See attachment
            c.Bound(r => r.Urgent).ReadOnly(true
                .ClientTemplate("<input type='checkbox' name='Urgent' value='<#= Urgent #>' />"); 
            c.Bound(r => r.Important).ReadOnly(true
                .ClientTemplate("<input type='checkbox' name='Important' value='<#= Important #>' />"); 
 

3 Answers, 1 is accepted

Sort by
0
dfgdfgdfgdfg
Top achievements
Rank 1
answered on 22 Oct 2010, 04:39 PM
Hi,
I have exactly the same issue, have you found any workaround?

Thanks,
Thomas
0
Qwizdom
Top achievements
Rank 1
answered on 22 Oct 2010, 08:24 PM
You can add the readonly attribute to your client template.

<input type='checkbox' name='Urgent' value='<#= Urgent #>' readonly />
0
dfgdfgdfgdfg
Top achievements
Rank 1
answered on 27 Oct 2010, 12:50 PM
Problem solved, thanks!
Tags
Grid
Asked by
Frank Michael
Top achievements
Rank 1
Answers by
dfgdfgdfgdfg
Top achievements
Rank 1
Qwizdom
Top achievements
Rank 1
Share this question
or