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

GridViewCheckBoxColumn changes state when moving to another row?

3 Answers 63 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rob Ainscough
Top achievements
Rank 1
Rob Ainscough asked on 06 Jan 2012, 05:00 PM
I have an unbound GridViewCheckBoxColumn in my RadGridView and it requires three click to actually set the state to "Checked", but what's even more annoying is once I set the state to Checked, if I navigate to another row in the grid the state will change back to an "unchecked" state???

Using SL4 with v.2011.3.1220.1040 RadControls.

Rob

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 06 Jan 2012, 05:19 PM
Hi Rob,

I would recommend you to take a look at this article for a reference.
Considering the loss of the state of a CheckBox, I would suggest you to bind the column to a property of your business object. Thus event when the grid is scrolled, the value will be kept. 

Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Rob Ainscough
Top achievements
Rank 1
answered on 06 Jan 2012, 06:30 PM
Ok, I've bound it to an object an the check values are being "saved" ... however whenever I move away from the row (to another row) the checkbox column defaults to being "grayed" out like it's disabled or something??

Rob
0
Maya
Telerik team
answered on 09 Jan 2012, 07:12 AM
Hi,

This would be the expected behavior since such is the style of CheckBox in the column. What you can do is to define your column as follows:

<telerik:GridViewDataColumn DataMemberBinding="{Binding IsChampion}" >
<telerik:GridViewDataColumn.CellTemplate>
     <DataTemplate>
             <CheckBox IsChecked="{Bidning IsChampion}"/>
     </DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>

 

Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Rob Ainscough
Top achievements
Rank 1
Answers by
Maya
Telerik team
Rob Ainscough
Top achievements
Rank 1
Share this question
or