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

Default Multi-row Selection behavior on RadGrid

2 Answers 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 23 Oct 2013, 07:02 PM
Hi,

I have a RadGrid that I setup to do multi-row selection client side of zip Codes (see attached pic)  the user can select all then deselect each row by clicking the client select column to define the set they want,  The problem occurs if the user clicks a row outside of the checkbox, instead of deselecting that row, it deselects all rows and then selects that row that was clicked.  is there a way to turn off (deselect) the clicked row by clicking anywhere in that row so it matches the bahaviour of clicking the client row selection checkbox column.  I can give you a login to the live application to see the behaviour if you want but I'd prefer not to share credentials on this forum.

Thanks

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 24 Oct 2013, 06:10 AM
Hi Jonathan,

Indeed, the behavior that you described is observed. However, it is expected. Please try the following code snippet to keep the selected rows on click of rows.

ASPX:
<telerik:RadGrid ID="RadGrid1"  runat="server" AllowMultiRowSelection="true" . . .>
    <MasterTableView >
        <Columns>
            <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
            </telerik:GridClientSelectColumn>         
          . . . . . . . .
        </Columns>
    </MasterTableView>
    <ClientSettings Selecting-AllowRowSelect="true" Selecting-UseClientSelectColumnOnly="true">
        <ClientEvents OnRowClick="toggleSelection" />
    </ClientSettings>
</telerik:RadGrid>

JS:
<script type="text/javascript">
 function toggleSelection(sender, args) {
   args.get_gridDataItem().set_selected(!args.get_gridDataItem().get_selected());
    }
</script>

Thanks,
Princy



0
Jonathan
Top achievements
Rank 1
answered on 24 Oct 2013, 05:53 PM
thanks Princy the Selecting-UseClientSelectColumnOnly="true" will work well.
Tags
Grid
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jonathan
Top achievements
Rank 1
Share this question
or