How to programmatically "unselect" a row in a grid

1 Answer 33 Views
Grid MultiSelect
Sven
Top achievements
Rank 1
Iron
Sven asked on 11 Aug 2021, 09:07 AM

Hope I picked the right forum section.. 

we maintain and program a rather large app using kendo ui and jquery based around c# code..

For a certain task I need to unselect some rows from the selection the user has done previously. But a google search only delivers results on "select grid row programmatically"
The grid in question allows multi-select of entire rows. How can I unselect certain rows based on the content of certain data-fields within said rows? 

Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Patrick | Technical Support Engineer, Senior
Telerik team
answered on 13 Aug 2021, 01:56 PM

Hi Sven,

Currently, the Kendo UI Grid does not have an unselect method built into the API.  That being said, we have a feature request which asks for this functionality, and I have added a vote on your behalf.  Please feel free to follow it for potential updates, and leave any comments within the thread.

Additionally, it does includes a possible workaround within the comments:

function removeRowSelection(tr) {
    tr.removeClass("k-state-selected");
};
    
removeRowSelection($("#grid tbody tr").eq(0)); 

Please let me know if you have any questions.

Regards,
Patrick
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid MultiSelect
Asked by
Sven
Top achievements
Rank 1
Iron
Answers by
Patrick | Technical Support Engineer, Senior
Telerik team
Share this question
or