GridViewCheckBoxColumn changes state when moving to another row?

4 posts, 0 answers
  1. Rob Ainscough
    Rob Ainscough avatar
    243 posts
    Member since:
    Jan 2010

    Posted 06 Jan 2012 Link to this post

    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
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 06 Jan 2012 Link to this post

    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 >>

  3. Rob Ainscough
    Rob Ainscough avatar
    243 posts
    Member since:
    Jan 2010

    Posted 06 Jan 2012 Link to this post

    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
  4. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 09 Jan 2012 Link to this post

    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 >>

Back to Top