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

2011 Q1 - current row deselection in client side

1 Answer 31 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eltiel
Top achievements
Rank 1
Eltiel asked on 19 Feb 2013, 08:20 AM
as my case, I used AllowKeyboardNavigation for selection using, when I pass up arrow key, the row will highlight, but the select color is "light", it different to click selection color. As my found out, it is "current row" selection. So my problem is how to deselect that highligh?

my clear row javascript:
 var masterTable = grid.get_masterTableView();
                var row = masterTable.get_dataItems();
                for (var i = 0; i < row.length; i++) {
                    masterTable.get_dataItems()[i].set_selected(false);

my grid client setting:
<ClientSettings AllowColumnHide="True" AllowRowHide="True" AllowKeyboardNavigation="True">
                            <KeyboardNavigationSettings AllowSubmitOnEnter="False" AllowActiveRowCycle="False" />
                            <Selecting AllowRowSelect="True" />
                            <ClientEvents OnKeyPress="OnKeyPress_grdCompany" ></ClientEvents>
                            <ClientEvents OnRowDblClick="OnRowDblClick_grdCompany" ></ClientEvents>
                            <ClientEvents  OnRowSelected="OnRowSelected_grdCompany"></ClientEvents>
                        </ClientSettings>

1 Answer, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 22 Feb 2013, 11:15 AM
Hi Eltiel,

The remaining row is not selected, rather it is the active row to enable the user to continue their navigation. You can verify this by checking the RadGridName.SelectedIndexes or SelectedItems collection. Please try the following approach to clear it:
function clearSelection() {
    var grid = $find("<%= RadGrid1.ClientID %>");
    grid.clearActiveRow();
    grid.get_masterTableView().clearSelectedItems();
}

Hope this helps. Please give it a try and let me know about the result.

Regards,
Eyup
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.
Tags
Grid
Asked by
Eltiel
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or