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

How to deselect a row when it is clicked in javascript

2 Answers 82 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sunil
Top achievements
Rank 1
Sunil asked on 02 Apr 2013, 07:45 PM
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 Answers, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 05 Apr 2013, 11:41 AM
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.
0
Sunil
Top achievements
Rank 1
answered on 05 Apr 2013, 02:40 PM
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
Tags
General Discussions
Asked by
Sunil
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Sunil
Top achievements
Rank 1
Share this question
or