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

Deselect rows selected w/ GridClientSelectColumn

1 Answer 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rick
Top achievements
Rank 1
Rick asked on 17 Sep 2013, 10:28 PM
How can I deselect rows selected in a RadGrid (ID's are being stored in a session variable) on click of a Clear/Reset button?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 18 Sep 2013, 04:47 AM
Hi Rick,

Please try the following code snippet to deselect the selected rows on an external button click.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="true">
    <MasterTableView>
        <Columns>
            <telerik:GridClientSelectColumn></telerik:GridClientSelectColumn>         
        </Columns>
    </MasterTableView>
    <ClientSettings EnableRowHoverStyle="true" Selecting-AllowRowSelect="true">   
    </ClientSettings>
</telerik:RadGrid>
<asp:Button ID="Button1" runat="server" Text="Clear" OnClientClick="return DeselectItems()" />

JS:
<script type="text/javascript">  
    function DeselectItems() {
        var grid = $find("<%= RadGrid1.ClientID %>");
        grid.get_masterTableView().clearSelectedItems();      
        return false;
    }
</script>

Thanks,
Princy
Tags
Grid
Asked by
Rick
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or