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

Populating the Drop down with distinct values from the already filtered values in Excel like filtering.

1 Answer 150 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 30 Aug 2016, 11:17 AM

The code  used is from already posted here. http://www.telerik.com/forums/excel-like-filtering-doesn't-fire-the-filterchecklistitemsrequested-event

The problem is I have got Excel like filtering to work for the radgrid But if I have a column already filtered in the radgrid and then another column is clicked for filtering then the dropdown should display onlt the distinct values from the already filtered values.But this doesn't seem to happen. It shows all the distinct values of the particular column even though it is not being display currently.

 

This behavior is correct with what is being shown in this demo https://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/excel-like-filtering/defaultcs.aspx

 I can see the when the apply/Clear filter is selected this data is being postback to the server. Can you tell me how I can get the column name and field so that I can store them and get the unique data from the filter conditions already set.

Can you suggest on how to achieve this functionality.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 02 Sep 2016, 12:07 PM
Hello Ben,

A possible solution is to hook OnItemCommand event handler and get the data field from the event arguments. Please check out the following code snippet.
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.HeaderContextMenuFilterCommandName)
    {
        Triplet aruments = e.CommandArgument as Triplet;
    }
}


Regards,
Kostadin
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Filter
Asked by
Ben
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or