Adding a large list of Id's to FilterDescriptor

2 posts, 0 answers
  1. Simon
    Simon avatar
    1 posts
    Member since:
    Feb 2016

    Posted 29 Jul Link to this post

    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);
            }

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 02 Aug Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top