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

2 posts, 0 answers
  1. Ben
    Ben avatar
    6 posts
    Member since:
    Jul 2016

    Posted 30 Aug 2016 Link to this post

    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.


  2. Kostadin
    Kostadin avatar
    1733 posts

    Posted 02 Sep 2016 Link to this post

    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;

    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.
Back to Top