This is a migrated thread and some comments may be shown as answers.

Adding a large list of Id's to FilterDescriptor

1 Answer 265 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 29 Jul 2016, 07:21 AM

So I have a large list of Id's that I want to create a filter for and return. I was just adding a FilterDescriptor for each one but I found that once it got over a certain amount I get a stack overflow error. So I am trying to use the IsContainedIn operator.

 

 

private static void AddSiteIdFilterToRequest(DataSourceRequest request, IList<Guid> siteGuidList, string columnName)
{
if (siteGuidList == null || !siteGuidList.Any()) return;

            var filterCollection = new CompositeFilterDescriptor { LogicalOperator = FilterCompositionLogicalOperator.Or };
            filterCollection.FilterDescriptors.Add(new FilterDescriptor { Member = columnName, MemberType = typeof(Guid), Operator = FilterOperator.IsContainedIn, Value = siteGuidList });
            request.Filters.Add(filterCollection);
        }

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 02 Aug 2016, 08:24 AM
Hello Simon,


I'm afraid that it is not clear what your scenario is. If you want to set DataSource filters manually you should use its filter method. If server operations option is enabled the DataSource will send the filter descriptors to the server for processing. If you need to pass some additional data with the request, this can be done by assigning a JavaScript function as described in this help article.

If you continue to experiencing difficulties and as your question does not seems to be directly related to this thread's topic, I would suggest you to open a separate support request and provide a small runnable sample which to demonstrate your exact scenario and the issue you are facing.

Regards,
Maria Ilieva
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Simon
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or