RadGrid ExcelLike Cascade Filtering

4 posts, 0 answers
  1. Suresh
    Suresh avatar
    1 posts
    Member since:
    Jun 2019

    Posted 14 Jun Link to this post

         Hi,

      i am  trying  to achieve cascade filtering in Excel like Filtering. but there is no clear information available. Please help me out

  2. Rumen
    Admin
    Rumen avatar
    14105 posts

    Posted 19 Jun Link to this post

    Hello Suresh,

    Have you tried by any chance the suggestion provided in the following forum thread Cascading Filters for the HeaderContextMenu?

    If your scenario is different, please provide more details along with a screenshot what you'd like to achieve. Thank you!

    Regards,
    Rumen
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Suresh
    Suresh avatar
    1 posts
    Member since:
    Feb 2016

    Posted 19 Jun in reply to Rumen Link to this post

    Hi  Rumen,

     

    Thank you for your reply.

     

    My Scenario is like i have 10 columns  and when i apply filter (excel like) in one column i have to show only respective matching data for Other columns to Filter.

  4. Rumen
    Admin
    Rumen avatar
    14105 posts

    Posted 24 Jun Link to this post

    HI Suresh,


    We have discussed the case with my colleague and we came up with a well working approach to cascade the filtering in grid by utilizing the GetBindingData method of RadGrid class.

    Example service method that returns only the available items for the CheckBoxList.
    Copy Code
    [OperationContract]
    public RadListBoxItemData[] LoadContactTitles(Dictionary<string, object> context)
    {
        using (NorthwindReadOnlyEntities entityFrameworkContext = new NorthwindReadOnlyEntities())
        {
            var allCustomers = (from customer in entityFrameworkContext.Customers
                                orderby customer.ContactTitle
                                select new RadListBoxItemData
                                {
                                    Text = customer.ContactTitle
                                }).Distinct().ToList<RadListBoxItemData>();
     
            // GetBindingData
            var data = RadGrid.GetBindingData(entityFrameworkContext.Customers.OrderBy(c => c.CustomerID),
              0, entityFrameworkContext.Customers.Count(), "", GridFilterExpression);
     
            List<RadListBoxItemData> result = data.Data.Select(x => new RadListBoxItemData()
            {
                Text = x.ContactTitle,
                Value = x.ContactTitle
            }).Distinct().ToList();
     
            return result.ToArray<RadListBoxItemData>();
        }
    }

    Attached I am sending you a sample project that you can test to see this in action. Please be aware that the Telerik.Web.UI.dll should be included by you in the bin folder of the web site.

    I hope this will prove helpful.

    Regards,
    Rumen
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top