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

RadGrid ExcelLike Cascade Filtering

3 Answers 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Suresh
Top achievements
Rank 1
Suresh asked on 14 Jun 2019, 08:09 PM

     Hi,

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

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 19 Jun 2019, 10:51 AM
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.
0
Suresh
Top achievements
Rank 1
answered on 19 Jun 2019, 03:34 PM

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.

0
Rumen
Telerik team
answered on 24 Jun 2019, 12:56 PM
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.
Tags
Grid
Asked by
Suresh
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Suresh
Top achievements
Rank 1
Share this question
or