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.

Cannot create functional custom FilterDescriptor in MVC grid

Thread ID:

Created:

Updated:

Platform:

Replies:

106636 Jan 19,2013 03:29 AM Jan 24,2013 10:46 AM ASP.NET MVC (Classic) 2
loading
Tags: Grid
Scott Belina
Asked On January 19, 2013 03:29 AM

I am creating a Grid in an MVC project (Razor). I attempt to create a custom filterdescriptor to have a default filter, as part of the grid definition, like
 
      .Filtering(filter =>
      {
          filter.AllowFiltering(true);
          filter.FilterMode(FilterMode.FilterBar);
          filter.FilterBarMode(FilterBarMode.OnEnter);
 
          filter.FilterDescriptors(descriptor =>
          {
              descriptor.Add(new FilterDescriptor("Group") { ColumnName = "Group"IsCaseSensitive = falseOperator = Syncfusion.Linq.FilterType.StartsWithPredicate = PredicateType.AndValue = "C" });
          });
      })
note the fluent .Add call ends up with the same result
               descriptor.Add(d => d.Group).MatchCase(false).FilterBy(Syncfusion.Linq.FilterType.Contains).Predicate(PredicateType.And).FilterValue("C");

When I attempt to page (or POST any grid operations), I get a 500 in response from .GridActions<>. When looking at the PagingParams passed to the action method, the FilterDescriptor corresponding to the one defined in the code above has a null ColumnName. args.FilterObject ==

"[{\"Column\":\"Group\",\"Operator\":6,\"Predicate\":0,\"Value\":\"C\",\"IsCaseSensitive\":false}]"

If, however, I do not create the descriptor in the definition, and through the FilterBar filter the Group field to C (so, do what results in exactly the same records), when POSTing, the FilterDescriptor corresponding to Group has a ColumnName = "Group" and arg.FilterObject == 

"[{\"ColumnName\":\"Group\",\"Operator\":\"6\",\"Value\":\"C\",\"Predicate\":\"0\",\"IsCaseSensitive\":false}]"

Note the FilterObject property is the same except the FilterBar FilterDescriptor version has "ColumnName" instead of "Column".

So, either I am doing something wrong or there is a bug in the FilterDescriptor.Add tree.

Suggestions on what to do to either (a) be correct or (b) work around?

thanks
 

Scott Belina
Replied On January 21, 2013 03:09 PM

I am using version 10.434.0.71 of the Syncfusion.Grid.MVC and Syncfusion.Shared.MVC , BTW, and 10.404.0.71 of Syncfusion.Core.

Rakesh D [Syncfusion]
Replied On January 24, 2013 10:46 AM

Hi Scott Belina,

 

Thanks for using Syncfusion products.

 

We regret to let you know that we can provide solution for this only through Direct-Trac incident, so could you please create the incident in your direct trac account.

You can login to your Direct-Trac account using the credentials and password that are provided by our sales team to create incident. I would request you to use the following link to login to your DT account.

 

http://www.syncfusion.com/account/Logon

 

Please let us know if you need further assistance. We would be happy to assist you.

 

Regards,

Rakesh D

 


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.

;