We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to clear all data from grid?

How to clear all data from grid dynamically?

3 Replies

RS Renjith Singh Rajendran Syncfusion Team January 27, 2020 06:39 AM UTC

Hi Ebi, 

Thanks for contacting Syncfusion support. 

Based on your requirement, we suggest you to clear the value for the variable assigned for the DataSource property. We have prepared a sample based on this requirement. Please download the sample from the link below, 
 
Please use the code below, 

 
<EjsButton @onclick="ButtonClick">Empty The Grid</EjsButton> 
 
<EjsGrid DataSource="@Orders"> 
    ... 
</EjsGrid> 
 
@code{ 
    ...     
    public void ButtonClick() 
    { 
        Orders = new List<Order>(); 
    } 
} 


 
Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 



ET ebi torabi February 1, 2020 06:50 AM UTC

Hi Renjith Singh Rajendran..Thank you very much. it work well.


RS Renjith Singh Rajendran Syncfusion Team February 3, 2020 04:59 AM UTC

Hi Ebi, 

Thanks for your update. 

We are happy to hear that you have achieved your requirement. 

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 


Loader.
Up arrow icon