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

Customize Grid Filter

1 Answer 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pena
Top achievements
Rank 1
Pena asked on 25 Aug 2011, 05:19 PM
Hi,

I am trying to set the values for Between filter in the PreRender event of the grid..
Filter works fine if I  pass a single value (int)
column.CurrentFilterFunction = GridKnownFunction.EqualTo

 

 

 

column.CurrentFilterValue = 60


But I need to pass a range of values and use "Between" filter. Tried couple of syntaxes given below but did not work. Can you please let me know what am I doing wrong?

 

If (

 

Not Page.IsPostBack) Then

 

RadGrid1.MasterTableView.FilterExpression =

 

"([Price] between 60 AND 70) "

 

 

 

Dim column As GridColumn = RadGrid1.MasterTableView.GetColumnSafe("Price")

 

column.CurrentFilterFunction =

 

GridKnownFunction.GreaterThanOrEqualTo

 

column.CurrentFilterValue = 60

column.AndCurrentFilterFunction =

 

GridKnownFunction.LessThanOrEqualTo

 

column.AndCurrentFilterValue = 70

 

 

'column.AndCurrentFilterFunction = GridKnownFunction.Between

 

 

 

'column.CurrentFilterFunction= 60,70

 

RadGrid1.MasterTableView.Rebind()

 

 

End If

 

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 26 Aug 2011, 06:58 AM
Hello Pena,

You can set the filter expression manually as explained in the following help documentation.
Operating with the FilterExpression of Telerik RadGrid Manually.

Thanks,
Princy.
Tags
Grid
Asked by
Pena
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or