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

[Solved] Finding Filter text client-side

3 Answers 134 Views
Grid
This is a migrated thread and some comments may be shown as answers.
EricL
Top achievements
Rank 1
EricL asked on 16 Jun 2008, 04:48 PM
Hi all,
Is there an easy way for someone to determine client-side if there is anything in any of the filters for any column that has a filter?

For instance, you can determine server side by looping through all of the grid columns and see if there is anything it its "CurrentFilterValue".  Is there a way to do this on the client?

Thanks in advance!

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 17 Jun 2008, 06:33 AM
Hello EricL,

While there is no property/method to allow you to determine this on the client, you can use the PreRender event handler, and access the RadGrid1.MasterTableView.FilterExpression, to determine if there is a filter applied to the control. If there is, you can assign it to a hidden input on the page, and access it easily from any client side method.
I hope this suggestion helps.

All the best,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
EricL
Top achievements
Rank 1
answered on 17 Jun 2008, 01:57 PM

Thanks Yavor for the information, however, this is not what I need.  What I was looking for was a function that would be something like this:
function FindFilter(sender, eventArgs)
{
    var grid = <% =RadGrid1.ClientID%>;
    var masterTable = grid.get_masterTableView();
    var columns = masterTable.get_columns();
    for (i = 0;i<columns.count;i++)
    {
        var isFiltered = colums[i].get_filterInformation(); //function to get the filter information from the column selected
        if (isFiltered)
        {
            //do something
        }
    }
}

Theree is currently a way to SET the filter information, just no way to GET the filter information client side, without having to go through a long and involved process. 

The other reason I need to do this client side is that I have implemented the context menu by row functionality using the client side event, but have done it in a class.  I didn't want to have to program over 10 grids with that functionality when I already have something client side that will do the work for me.

Thanks for your help!

0
Yavor
Telerik team
answered on 20 Jun 2008, 07:04 AM
Hi EricL,

Unfortunately, as mentioned previously, there is no easy way to get this information. This makes, however, a nice feature suggestion, and I will pass it along to out developers, to consider its possible implementation for one of the upcoming versions of the control.
I hope that the suggested work-around is suitable for you in the meantime.

Sincerely yours,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
EricL
Top achievements
Rank 1
Answers by
Yavor
Telerik team
EricL
Top achievements
Rank 1
Share this question
or