How to deselect a row when it is clicked in javascript

3 posts, 0 answers
  1. Sunil
    Sunil avatar
    2 posts
    Member since:
    Nov 2012

    Posted 02 Apr 2013 Link to this post

    I have a RadGridView where I would like the following behavior:
    - only 1 or 0 rows can be selected at any given time
    - if I click on a row that is unselected, then make only this row selected
    - if I click on a row that is already selected, should be deselected

    Can i get this behavior using client methods. 
  2. Kostadin
    Admin
    Kostadin avatar
    1733 posts

    Posted 05 Apr 2013 Link to this post

    Hi Sunil,

    A possible solution is to check whether the row is already been selected and if it is not then you could select it otherwise you you could deselect it. For your convenience I prepared a small sample and attached it to this forum thread.

    All the best,
    Kostadin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Sunil
    Sunil avatar
    2 posts
    Member since:
    Nov 2012

    Posted 05 Apr 2013 Link to this post

    Hi Kostadin,

    Thank you very much for your solution it worked great. I have written a js method but your solution is much simpler than mine and will use this.

    Thanks
    Sunil
Back to Top