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.
Unfortunately, activation email could not send to your email. Please try again.

Custom Excel Style Grid Toolbar Item to Clear All Filters

Thread ID:

Created:

Updated:

Platform:

Replies:

128935 Feb 16,2017 12:20 PM Feb 22,2017 12:10 AM ASP.NET Web Forms 3
loading
Tags: Grid
Levi Leonards
Asked On February 16, 2017 12:20 PM

I have an Excel Style Grid where every column can be filtered.
How can I create a Custom Toolbar Item to clear all of the filters on the grid and load the default data set?

Pavithra Subramaniyam [Syncfusion]
Replied On February 17, 2017 01:32 AM

Hi Levi, 

We have analyzed your query and we have achieved your requirement by using CustomToolbarItem  property of ToolbarSettings and we  can clear the filtering using clearFiltering method of ejGrid control. Actions for this customized toolbar is defined in ToolbarClick event. Please refer the following code snippet, online document link and sample link . 
 
<ej:Grid ID="OrdersGrid" runat="server" AllowFiltering="True" AllowPaging="True" > 
<FilterSettings FilterType="Excel" />  
       <ClientSideEvents ToolbarClick="onToolBarClick" /> 
       <EditSettings AllowAdding="True" AllowDeleting="True" AllowEditing="True"></EditSettings> 
       <ToolbarSettings ShowToolbar="True"> 
                    <CustomToolbarItem> 
                        <ej:CustomToolbarItem Text="clearFilter" /> 
                    </CustomToolbarItem> 
       </ToolbarSettings> 
       <Columns> 
                  . . . 
       </Columns> 
</ej:Grid> 
    . . . 
<script type="text/javascript"> 
            function onToolBarClick(sender) { 
                if (sender.itemName == "clearFilter") 
                    this.clearFiltering(); 
            } 
</script> 
 
                                            2. https://help.syncfusion.com/api/js/ejgrid#methods:clearfiltering 
 
 
Regards, 
Pavithra S. 


Levi Leonards
Replied On February 21, 2017 04:23 PM

Perfect example, thanks!

Pavithra Subramaniyam [Syncfusion]
Replied On February 22, 2017 12:10 AM

Hi Levi, 
 
Thanks for your update.           
We are happy that the provided information helped you. 
 
Regards, 
Pavithra S. 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;