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

Filter template & radlistbox & filter expression

7 Answers 126 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 2
Bill asked on 16 Mar 2010, 11:50 PM
Is it possible to use a list box in a filter template and then set up an "in" filter expression?
example: select * from table where colname in ("a","b","c","d")...

7 Answers, 1 is accepted

Sort by
0
Bill
Top achievements
Rank 2
answered on 19 Mar 2010, 07:02 PM

Filter functions

The GridKnownFunction enumeration lists the possible filter functions that can appear in the list of filter functions. The following table lists the possible GridKnownFunction values:

Value Description
NoFilter No filter is applied, filter controls are cleared.
Contains Same as: dataField LIKE '%value%'
DoesNotContain Same as: dataField NOT LIKE '%value%'
StartsWith Same as: dataField LIKE 'value%'
EndsWith Same as: dataField LIKE '%value'
EqualTo Same as: dataField = value
NotEqualTo Same as: dataField != value
GreaterThan Same as: dataField > value
LessThan Same as: dataField < value
GreaterThanOrEqualTo Same as: dataField >= value
LessThanOrEqualTo Same as: dataField <= value
Between Same as: value1 <= dataField <= value2.
Note that value1 and value2 should be separated by [space] when entered as filter.
NotBetween Same as: dataField <= value1 && dataField >= value2.
Note that value1 and value2 should be separated by [space] when entered as filter.
IsEmpty Same as: dataField = ''
NotIsEmpty Same as: dataField != ''
IsNull Only null values.
NotIsNull Only those records that do not contain null values in the column.
Custom A custom filter function. The filter value should contain a valid filter expression, including data field, operators, and value.

Can someone point me to where filter functions are defined and documentation on how to create a custom function?
Is it possible to supply a list of values to EqualTo?  If so what is the separator?
0
Yavor
Telerik team
answered on 22 Mar 2010, 10:20 AM
Hello Bill,

One possible option in this case would be to concatenate the filter expressions via the And/Or keywords. The following topic contains additional information on the matter:

http://www.telerik.com/help/aspnet-ajax/grdoperatewithfilterexpression.html

I hope it gets you started properly.

All the best,
Yavor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Bill
Top achievements
Rank 2
answered on 22 Mar 2010, 07:06 PM
Is this formatting (e.g. putting [ ] around the column names) internal to the control or is it being passed to the database?? We're using Oracle...

0
Bill
Top achievements
Rank 2
answered on 23 Mar 2010, 12:29 AM
The link you sent is server side code - it can't be done client side like the examples for the filter template / combobox???
                                <script type="text/javascript">  
                                    function FilterOnSupervisorsName(sender, args) {  
                                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");  
                                        tableView.filter("subjects_supervisor", args.get_item().get_value(), "EqualTo");  
                                    }  
 
0
Yavor
Telerik team
answered on 23 Mar 2010, 04:00 PM
Hi Bill,

The brackets/escape symbols which the article contains are added/constructed by the control internally. However, if you are setting the filter expression directly, knowing the proper syntax is important.
Additionally, you can also use the client side methods which you included to fire a filter command. However, one cannot build the filter expression at once in this manner. Another option is to use the following method:

http://www.telerik.com/help/aspnet-ajax/grid_firecommand.html

to fire a custom command. This custom command can be passed all the information to construct the filter expression directly (rather than firing each command in succession). On the server, this command can be intercepted in the ItemCommand handler, and the filter expression can be constructed as per the information in the article.
I hope this information helps.

Greetings,
Yavor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Bill
Top achievements
Rank 2
answered on 23 Mar 2010, 08:06 PM

A string holding the filter conditions data

Example:

fireCommand("Filter", "OrderID|?GreaterThan|10258|?LessThan|10342")

I'm back to not knowing the syntax - in this case for the filter strings - where is this stuff documented?


In the article you pointed out the rest of the row in the table deals with "HeaderContextMenuFilter" but the example just says "Filter"

0
Yavor
Telerik team
answered on 26 Mar 2010, 12:48 PM
Hello Bill,

Additional information on the filter expression syntax is contained in the following article:

http://www.telerik.com/help/aspnet-ajax/grdoperatewithfilterexpression.html

The last section contains information covering all possible values, with a number of datasources, pretty much covering all possible setups. Let me know how this approach meets your requirements.

Greetings,
Yavor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Bill
Top achievements
Rank 2
Answers by
Bill
Top achievements
Rank 2
Yavor
Telerik team
Share this question
or