How to deselect all rows in a grid

How do you deselect all rows is a grid?

1 Reply 1 reply marked as answer

VN Vignesh Natarajan Syncfusion Team August 5, 2020 07:15 AM UTC

Hi Michael,  
 
Thanks for contacting Syncfusion support.  
 
Query: “How do you deselect all rows is a grid? 
 
We suggest you to achieve your requirement using ClearSelection() method of Grid. Refer the below code example.  
 
<SfButton Content="Clear Selection" OnClick="Clear"></SfButton> 
  
  
<SfGrid @ref="Grid" DataSource="@Orders" AllowSelection="true" AllowPaging="true"> 
    <GridSelectionSettings Type="SelectionType.Multiple"></GridSelectionSettings> 
. . . . . . .  
</SfGrid> 
  
@code{ 
    public List<Order> Orders { getset; } 
    SfGrid<Order> Grid { getset; } 
    public async Task Clear() 
    { 
        await Grid.ClearSelection(); 
    } 
 
  
Refer our API documentation for your reference 
 
 
Kindly get back to us if you have further queries.  
 
Regards, 
Vignesh Natarajan 


Marked as answer
Loader.
Up arrow icon