Hi,
I am using RadContextMenu on RadGrid.
I have a little problem with selection row. When I activate context menu with right click on grid, that row select which is fine.
But when I select another row previous row is still selected.
How do I deselect that row?
thank you,
Jan
I am using RadContextMenu on RadGrid.
I have a little problem with selection row. When I activate context menu with right click on grid, that row select which is fine.
But when I select another row previous row is still selected.
How do I deselect that row?
thank you,
Jan
4 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 04 Sep 2012, 03:39 AM
Hi,
I guess you have set the RadGrid property AllowMultiRowSelection to true. Try setting this property to false.
ASPX:
Thanks,
Shinu.
I guess you have set the RadGrid property AllowMultiRowSelection to true. Try setting this property to false.
ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="false" >Thanks,
Shinu.
0
Jan
Top achievements
Rank 1
answered on 04 Sep 2012, 06:26 AM
Hi Shinu,
If I disable AllowMultiRowSelection, then I also disable "shift+click" multiselection.
Is there any other way?
If I disable AllowMultiRowSelection, then I also disable "shift+click" multiselection.
Is there any other way?
0
Accepted
Shinu
Top achievements
Rank 2
answered on 05 Sep 2012, 04:01 AM
Hi Jan,
Try adding the following javascript inside the ClientEvent 'OnRowContextMenu' for allowing only one row selection at a time. AllowMultiRowSelection is set to true. Here is the sample code i tried.
Javascript:
Thanks,
Shinu.
Try adding the following javascript inside the ClientEvent 'OnRowContextMenu' for allowing only one row selection at a time. AllowMultiRowSelection is set to true. Here is the sample code i tried.
Javascript:
<script type="text/javascript"> function RowContextMenu(sender, eventArgs) { var gridSelectedItems = sender.get_masterTableView().get_selectedItems(); for (var i = 0; i < gridSelectedItems.length; i++) { if (gridSelectedItems[i].get_selected()) { gridSelectedItems[i].set_selected(false); } } //code for context menu }</script>Thanks,
Shinu.
0
Jan
Top achievements
Rank 1
answered on 05 Sep 2012, 06:42 AM
I have customized your JavaScript and get to solution.
Thank you Shinu.
Thank you Shinu.