@Html.EJ().Button("buttonnormal").Text("RemoveFilter").ClientSideEvents(eve => eve.Click("click")) @(Html.EJ().Grid<Sample119799.OrdersView>("FlatGrid") .Datasource((IEnumerable<object>)ViewBag.datasource) .AllowPaging() /*Paging Enabled*/ .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing(); }) .AllowSorting() .AllowFiltering() .FilterSettings(filter => { filter.FilterType(FilterType.Menu); }) .ToolbarSettings(toolbar => { toolbar.ShowToolbar().ToolbarItems(items => { items.AddTool(ToolBarItems.Add); items.AddTool(ToolBarItems.Edit); items.AddTool(ToolBarItems.Delete); items.AddTool(ToolBarItems.Update); items.AddTool(ToolBarItems.Cancel); }); }) .ClientSideEvents(eve => eve.Create("action").ActionComplete("complete")) .Columns(col => { col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add(); col.Field("CustomerID").HeaderText("Customer ID").ValidationRules(v => v.AddRule("required",true).AddRule("minlength", 3)).Width(80).Add(); col.Field("EmployeeID").HeaderText("Employee ID").ValidationRules(v => v.AddRule("required",true)).TextAlign(TextAlign.Right).Width(75).Add(); col.Field("Freight").HeaderText("Freight").TextAlign(TextAlign.Right).Width(75).Format("{0:C}").Add(); }))
<script type="text/javascript"> function action(args) { var grid = $("#FlatGrid").ejGrid("instance"); grid.filterColumn("CustomerID", "equal", "ALFKI", "and", true); }
// Remove Filter for the particular column
function click(args) { var grid = $("#FlatGrid").ejGrid("instance"); grid.clearFiltering("CustomerID"); } |
Sample: http://www.syncfusion.com/downloads/support/forum/123194/ze/Sample119799_(2)1996636022
Regards,
Prasanna Kumar N.S.V