function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Akshay MenseAkshay Mense 

How to clear selected rows in LWC lightning data table after table refresh

VinayVinay (Salesforce Developers) 
Hi Akshay,

Review below examples.

http://sfdchelper.com/how-to-clear-selected-rows-in-lightning-datatable/
https://salesforce.stackexchange.com/questions/200436/lightningdatatable-clear-row-selections

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
Akshay MenseAkshay Mense
Hi Vinay, I have already referred these links but they did not help me out
 
Lalit HembramLalit Hembram
Hello Akshay but haw to wark these two mention link please describe thanks for share.
https://santhaldisom.in/
Raj Kishore 12Raj Kishore 12
Hi Akshy if you know Please tell me information about LWC lighting data 
https://currentsarkarijobs.com/
Paweł KalinowskiPaweł Kalinowski
Hey Ashkay,

I've had the same issue; the only thing that worked for me was setting the max-row-selection property to 0 and then back to the default number within the javascript like this:

this.template.querySelector('lightning-datatable').maxRowSelection=0;
this.template.querySelector('lightning-datatable').maxRowSelection=5;

This will clear all row selections for you.
kc gaurkc gaur

Hi

I have also faced the same issue and I found the solution by setting the selectedRows property of datatable. If you have selected rows in datatable and later you want to clear that then you can do this like below

this.template.querySelector('lightning-datatable').selectedRows=[];

Lalit HembramLalit Hembram
Any can learn me about the LWC lightning data table I want to know
https://santhaldisom.in/edi-full-form/