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

Row Double click to select multiple rows

1 Answer 60 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 15 Oct 2010, 02:56 PM
Hi..
I have the following code that allows me to double click the row to select a row. The problem is that it doesn't allow me to multi select rows.  If I select 1 row and then double click on another row - the first row becomes unselected.  How can make it work so that I can multi select by clicking anywhere in the row.
thx


 

 

<script type="text/javascript">

 

 

 

function OnRowDblClick(sender, args) {

 

 

 

var index = args._itemIndexHierarchical;

 

__doPostBack(

 

"<%=GridManage.UniqueID %>", "RowDblClicked:" + index);

 

}

 

 

</script>

 



 

 

<telerik:RadGrid ID="GridManage" runat="server"

 

 

 

AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"

 

 

 

AllowMultiRowSelection="True"

 

 

 

ShowStatusBar="True" Skin="WebBlue" GridLines="None"

 

 

 

onselectedindexchanged="GridManage_SelectedIndexChanged"

 

 

 

onitemcreated="GridManage_ItemCreated"

 

 

 

onneeddatasource="GridManage_NeedDataSource"

 

 

 

OnPageSizeChanged="GridManage_PageSizeChanged"

 

 

 

GroupingEnabled="False" onitemdatabound="GridManage_ItemDataBound" ><AlternatingItemStyle BackColor="Silver" />

 

 

 

<MasterTableView TableLayout="Fixed" DataKeyNames="ID,VIP" >

 



..............


 

 

 

<ClientSettings>

 

 

 

<ClientEvents OnRowDblClick="OnRowDblClick"/>

 

 

 

<Selecting AllowRowSelect="true" />

 

 

 

</ClientSettings>

 

 

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 15 Oct 2010, 04:48 PM
Hi Jon,

Several rows can be selected either by: 
    - holding the Ctrl key when clicking the rows 
    - dragging a region with the mouse to select all underlying rows. To accomplish this task you have to set the ClientSettings -> Selecting -> EnableDragToSelectRows property to true. 
    - clicking a row, holding the Shift key and clicking another row upwards/downwards Later on, you can unselect a row by holding the Crtl key and clicking the row. You don't need this if you have GridClientSelectColumn added.

Additionally, you can examine the code library below which shows how to select multiple items without holding the Ctrl key:
http://www.telerik.com/community/code-library/aspnet-ajax/grid/how-to-select-multiple-items-without-holding-the-ctrl-key.aspx

I hope this helps.

Best wishes,
Pavlina
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
Tags
Grid
Asked by
Jon
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or