clear selection

I want to clear selection before filtering... is it possible??

 I use EJ not EJ2

ale

3 Replies 1 reply marked as answer

PK Padmavathy Kamalanathan Syncfusion Team August 7, 2020 10:59 AM UTC

Hi Alessandro, 
  
Thanks for contacting Syncfusion Forums. 
  
QUERY: Clear selection before filtering 
  
For clearing the selection before performing filter operation, we suggest you to call "clearSelection" method in the actionBegin event with requestType as "filtering". 
  
Please check the below code snippet, 

 
  
@(Html.EJ().Grid<object>("Grid").Datasource((IEnumerable<object>)ViewBag.data)  
     .AllowPaging().AllowFiltering()  
     .ClientSideEvents(eve => { eve.ActionBegin("ActionBegin"); })  
      .Columns(col =>  
      {                                              
      col.Field("OrderID").HeaderText("OrderID").IsPrimaryKey(true).Width(90).Add();  
      col.Field("EmployeeID").HeaderText("Employee ID").Add();  
       }  
   ))  
<script type="text/javascript">  
    function ActionBegin(args) {  
        if (args.requestType == "filtering") { // before filtering 
            this.clearSelection(); //calling clearSelection method  
        }  
    }  
    </script>  
  
Please check the below help documentation, 
  
Kindly get back to us for further assistance. 
  
Regards, 
Padmavathy Kamalanathan 


Marked as answer

AD Alessandro Degola August 7, 2020 12:11 PM UTC

it works like a charm

ale


PK Padmavathy Kamalanathan Syncfusion Team August 10, 2020 12:00 PM UTC

Hi Alessandro,

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

 
Kindly get back to us for further assistance. 
  
Regards, 
Padmavathy Kamalanathan 


Loader.
Up arrow icon