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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Excel Filter MaxFilterChoices

Thread ID:





131585 Jul 18,2017 09:15 AM UTC Jul 19,2017 12:44 PM UTC ASP.NET MVC 1
Tags: Grid
Carsten Buchmann
Asked On July 18, 2017 09:15 AM UTC

we using a URL Adapter and the FilterType.Excel. The property MaxFilterChoices is set to 25. But in the filter menu we only see less than 25 items. I see that the result from the method in the URL adapter returns 25 items (we using the DataManager) but the grid will group it on the column. 

How can I extend our adapter method or grid to get 25 items on each column filter?

.FilterSettings(filter => { filter.FilterType(FilterType.Excel).MaxFilterChoices(25); })

Kind regards,

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On July 19, 2017 12:44 PM UTC

Hi Carsten,  
Thanks for contacting Syncfusion Support.  
The default behavior will collect the numbers of records mentioned in the MaxFilterChoices from the server-end and it will populate the distinct set of the values in the checkbox list. Hence, 25 records will be reduced to the distinct set of records which is obviously a reduced count in the Excel filter when compare to the MaxFilterChoices value. So, we suggest to return the distinct set of records to the client end. Refer to the following code example. 
We are selecting the required filtering column in the ActionBegin event of the Grid and same has been retrieved from the server-end as a distinct set of records. 
         .Datasource(ds => ds.URL("/Home/DataSource1").Adaptor(AdaptorType.UrlAdaptor)) 
                    .Columns(col => 
                                col.Field("CustomerID").HeaderText("Customer ID").Width(100).Add(); 
    function onActionBegin(args) { 
        if (args.requestType == "filterchoicerequest") { 
            //selects only the filtering column 
            //which prevents the serialization errror. 
       public ActionResult DataSource1(Syncfusion.JavaScript.DataManager dm) 
            IEnumerable datasource = OrderRepository.GetAllRecords(); 
            DataOperations operation = new DataOperations(); 
            if (dm.Where != null)//for filtering 
                datasource = operation.PerformWhereFilter(datasource, dm.Where, dm.Where[0].Condition);  
            //selects only the required columns 
            if (dm.Select != null) 
                datasource = operation.PerformSelect(datasource, dm.Select); 
                 convert dataSource to the distinct set of the records based on the dm.Select value 
            int count = datasource.AsQueryable().Count(); 
            if (dm.Skip >= 0)//for paging 
                datasource = operation.PerformSkip(datasource, dm.Skip); 
            if (dm.Take > 0)//for paging 
                datasource = operation.PerformTake(datasource, dm.Take); 
            return Json(new { result = datasource, count = count }); 
Seeni Sakthi Kumar S. 


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon