Problem with CheckBox Column in GridView

32 posts, 0 answers
  1. Hayley
    Hayley avatar
    5 posts
    Member since:
    Sep 2008

    Posted 22 Apr 2009 Link to this post

    Hello,

    I have a CheckBox column in a GridView. Since downloading SP1 when you now try check/uncheck the checkbox it does nothing (if the row is not selected) and requires and second click in order to check/uncheck the checkbox. This was working fine prior to SP1, can you please help?

    Thanks,

    Hayley

  2. Stefan Dobrev
    Admin
    Stefan Dobrev avatar
    790 posts

    Posted 22 Apr 2009 Link to this post

    Hi Hayley,

    You are right that multiple clicks are required, one for focusing the cell and second to enter in edit mode, which is disturbing. We are aware of this unexpected behavior and will fix it in our next release.

    Thanks again for pointing this out. I have updated your Telerik points.

    All the best,
    Stefan Dobrev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
  4. Hayley
    Hayley avatar
    5 posts
    Member since:
    Sep 2008

    Posted 22 Apr 2009 Link to this post

    Hi Stefan,

    Thanks for your reply. Do you know when the next release will be?

    Thanks,

    Hayley
  5. Stefan Dobrev
    Admin
    Stefan Dobrev avatar
    790 posts

    Posted 24 Apr 2009 Link to this post

    Hi Hayley,

    We do not have a specific date for the next release, but we are aiming for the middle of the summer. Till then you can check this forum post for a workaround.

    Regards,
    Stefan Dobrev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Tyree
    Tyree avatar
    105 posts
    Member since:
    Dec 2006

    Posted 09 May 2009 Link to this post

    I hope this will also address the multiple clicks needed for buttons to?
  7. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 13 May 2009 Link to this post

    Hello Tyree,

    Fix for this will be released in our upcoming service pack - next week.

    Sincerely yours,
    Vlad
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. Kevin
    Kevin avatar
    7 posts
    Member since:
    Apr 2009

    Posted 05 Jun 2009 Link to this post

    Hello,

    I wonder if this problem has been addressed in the latest SP. I tried the May 29 build, but still see the problem.

    Thanks,

    Kevin
  9. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 09 Jun 2009 Link to this post

    Hello Kevin,

    Indeed the problem is addressed in our current official service pack - you can find small application attached.

    Sincerely yours,
    Vlad
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  10. Kevin
    Kevin avatar
    7 posts
    Member since:
    Apr 2009

    Posted 09 Jun 2009 Link to this post

    Vlad,

    Thanks for the example. It demonstrates one-click checkbox selection works but it does not solve my problem. In my case I have a List of objects. One of the properties of the object is a boolean, and once bound to the grid I have a checkbox column. To check this checkbox, it still requires me to do 3 clicks. In the example you show, the checkbox is not part of the object, so I can't update the object's property and have it automatically reflect on the grid.

    Thanks,

    Kevin
  11. Nedyalko Nikolov
    Admin
    Nedyalko Nikolov avatar
    871 posts

    Posted 12 Jun 2009 Link to this post

    Hi Kevin,

    Indeed when you edit boolean property you will need to click twice to put the cell in edit mode and the next click will check the CheckBox. We plan to introduce some modifications for the editing (logic and usability). Our plans are to implement an enum of conditions which will control enter into edit mode behavior.

    I cannot commit that this will be available for the next release, but we will do our best in order to supply this as soon as possible. As a workaround you can handle RadGridView.CurrentCellChanged and call RadGridView.BeginEdit() for CheckBox columns.

    I'm attaching a sample project for your reference.

    Sorry for the inconvenience caused.

    Greetings,
    Nedyalko Nikolov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  12. Kevin
    Kevin avatar
    7 posts
    Member since:
    Apr 2009

    Posted 12 Jun 2009 Link to this post

    Hi Nedyalko,

    Thanks for the example. I added a boolean property to the Person class to add a checkbox column to the grid. However, it still requires 2 clicks to get the box checked/unchecked. Although this workaround has save you one click (from 3 down to 2), it could potentially cause the Grid to freeze as the event CurrentCellChanged gets fired when any cell on the grid get changed. This is especially true when Multiselect is turned on and your code performs some update to cells on the selected rows.

    Thanks,

    Kevin
  13. Nedyalko Nikolov
    Admin
    Nedyalko Nikolov avatar
    871 posts

    Posted 17 Jun 2009 Link to this post

    Hello Kevin,

    Indeed this example is just a workaround which is far from the perfect solution.  We scheduled improvements to editing logic and UI usability just after next official release, which means that you can get them soon after that.

    I'll send you "latest internal build" as soon as this enhancement is ready.

    Don't hesitate to contact us if you have other questions.

    Greetings,
    Nedyalko Nikolov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  14. Ludovic Gerbault
    Ludovic Gerbault avatar
    226 posts
    Member since:
    Apr 2009

    Posted 04 Aug 2009 Link to this post

    Hello,

    We're facing today a similar problem.
    We've upgraded our project to the Q2 SL3 version, and using a celltemplate and celledittemplate to bind a checkbox on a gridview column, but we still need to click like 3 times to get the checkbox checked.

    I thought this issue would be fixed in this version. Maybe there's a particular way to activate this functionality that I'm not aware of.

    Anyway, could you please tell us how to check this box on a single click ?
  15. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 04 Aug 2009 Link to this post

    Hello,

    You can declare desired CheckBox in CellTemplate directly instead of CellEditTemplate to achieve your goal.

    Greetings,
    Vlad
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  16. Ludovic Gerbault
    Ludovic Gerbault avatar
    226 posts
    Member since:
    Apr 2009

    Posted 04 Aug 2009 Link to this post

    That's the problem exactly.

    The checkbox is already declared in the CellTemplate.

    Here's the code snippet of the declaration:

     <grid:RadGridView x:Name="rgvConsultation" 
                                  IsReadOnly="True" 
                                  AutoGenerateColumns="False" 
                                  Grid.Row="6" 
                                  ColumnsWidthMode="Fill" 
                                  ScrollMode="RealTime" 
                                  RowIndicatorVisibility="Collapsed"
                                  Margin="0,10"
                                  ShowColumnFooters="True"
                                  RowDetailsVisibilityMode="VisibleWhenSelected"
                                  ScrollViewer.VerticalScrollBarVisibility="Visible"
                                  RowLoaded="rgvConsultation_RowLoaded">

    [... Other columns declaration...]
    <grid:GridViewDataColumn x:Name="chbPointage"
                                                 Width="Auto"
                                                 TextAlignment="Center">
                        <grid:GridViewDataColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox x:Name="chBoxPointage" 
                                          Visibility="Collapsed"
                                          Loaded="chBoxPointage_Loaded"
                                          HorizontalAlignment="Center"/>
                            </DataTemplate>
                        </grid:GridViewDataColumn.CellTemplate>
                        </grid:GridViewDataColumn>

    And it still needs 3 clicks to check the box.
  17. Kevin
    Kevin avatar
    2 posts
    Member since:
    Jun 2009

    Posted 04 Aug 2009 Link to this post

    Hello,

    I have tried to use CellTemplate ins SL3 and it seems to work as expected. Here is my DataTemplate:

                        <DataTemplate>
                                <CheckBox x:Name="chBoxPointage" 
                                         IsChecked="{Binding BOOL_VAL, Mode=TwoWay}"
                                          HorizontalAlignment="Center"/>
                            </DataTemplate>

    The only different is that IsChecked is bound within the xaml vs yours binding probably in the checkbox's loaded event. However, it shouldn't matter. Try the plain checkbox (without any loaded event or anything inside) to see if you can achieve one-click selected.

    Thanks,

    Kevin
  18. Celeste
    Celeste avatar
    34 posts
    Member since:
    May 2009

    Posted 06 Oct 2009 Link to this post

    Hi:

    I am using a Checkbox inside Column.CellTemplate, and now it's only necesary one click. But I need when I set column.IsReadOnly = true, checkbox set enables to false. How can I do? Because column.IsReadOnly does not work.

    Celeste.
  19. Nedyalko Nikolov
    Admin
    Nedyalko Nikolov avatar
    871 posts

    Posted 08 Oct 2009 Link to this post

    Hello Celeste,

    We intend to introduce IsEnabled property of the GridViewColumn in order to make this task a little bit easier. Unfortunately I cannot commit with any specific date or release.
    Meanwhile you can take a look at this online example.
    Hope this helps.

    All the best,
    Nedyalko Nikolov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  20. Kevin Happe
    Kevin Happe avatar
    28 posts
    Member since:
    Jan 2010

    Posted 04 Jun 2010 Link to this post

    I am using 2010 1 quarter sp2.

    I want the user to be able to single click a checkbox in a column and have the checkbox switch from checked to unchecked.
    I do not want the user to have to click twice.  (First click to put it in edit mode and the second click to change the checkbox.)

    So how would I implement this behavior in the current release.  Another caviat  is that I have to add the columns dynamically in code behind and not in the xaml.

    Thanks
    Kevin
  21. Nedyalko Nikolov
    Admin
    Nedyalko Nikolov avatar
    871 posts

    Posted 09 Jun 2010 Link to this post

    Hello Kevin Happe,

    You can use code similar to this:
    GridViewCheckBoxColumn col = new GridViewCheckBoxColumn();
    col.AutoSelectOnEdit = true;
     
    this.radGridView.Columns.Add(col);

    I hope this will help.

    Sincerely yours,
    Nedyalko Nikolov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  22. vidya
    vidya avatar
    3 posts
    Member since:
    Jun 2010

    Posted 20 Jun 2010 Link to this post

    I cannot find GridViewCheckBoxColumn . Please help.

    Thanks
  23. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 21 Jun 2010 Link to this post

    Hello,

     Do you have our latest service pack - Q1 2010 SP2? 

    All the best,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  24. Kevin Happe
    Kevin Happe avatar
    28 posts
    Member since:
    Jan 2010

    Posted 22 Jun 2010 Link to this post

    Even when I add the Checkboxcolumn and set AutoSelectOnEdit to true.  I still have to click twice.  Is there an edit trigger that I need to be using?
  25. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 25 Jun 2010 Link to this post

    Hi Kevin Happe,

    Unfortunately, this property work only when the corresponding row is already in edit mode. I have prepared simple project with behavior class attached to the grid that enables the desired functionality - single click on the checkbox column will change the checkbox state. Currently we are planning to make this behavior default for this column.

    Please have a look at attachment and let me know if this work for you.

    Kind regards,
    Tsvyatko
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  26. gjm
    gjm avatar
    11 posts
    Member since:
    May 2010

    Posted 07 Jul 2010 Link to this post

    How do I do this at runtime? I mean when binding the grid at runtime
  27. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 12 Jul 2010 Link to this post

    Hello Gopi Menon,

    I have modified the sample application to work when setting itemsSource to the grid at run-time. Please check the attachment and let me know if you need any further assistance.

    Sincerely yours,
    Tsvyatko
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  28. gjm
    gjm avatar
    11 posts
    Member since:
    May 2010

    Posted 23 Jul 2010 Link to this post

    Sorry for not being clear. I am actually creating my grid at runtime. I dont it on my xaml.

    Thanks,
    Gopi
  29. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 28 Jul 2010 Link to this post

    Hello Gopi Menon,

    Please, check the attachment. It contains the modified example demonstrating how to create the grid in code behind in this case. Let me know if you have any other questions.

    Kind regards,
    Tsvyatko
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  30. Stuart
    Stuart avatar
    30 posts
    Member since:
    Jun 2010

    Posted 05 Oct 2010 Link to this post

    Hi

    I've tried AutoSelectOnEdit="True" but I too have to click twice before my checkboxes register the change.

    Is there anything else I need to do?

    Thanks

  31. Joachim
    Joachim avatar
    39 posts
    Member since:
    Jul 2010

    Posted 06 Oct 2010 Link to this post

    Hi Telerik Team !

    I have the same problem with the last release when i want to click on a button within a column i have to click twice :
    the first time to set the focus, the second time to push the button O_o ??

    In advance thanks for your help guys.

    Joachim.
Back to Top
DevCraft banner