
i have a radfilter.
how can i go through the data text field in the radfilter, that are generated to build a query
to filter the data.
i mean is there any way to go through the data in controls that controls are generated
in Radfilter to build the query.
9 Answers, 1 is accepted
In order to get the expression tree built by the RadFilter control, you can use the ApplyFilterExpressions event:
protected
void
RadFilter1_ApplyExpressions(
object
sender, RadFilterApplyExpressionsEventArgs e)
{
RadFilterSqlQueryProvider provider =
new
RadFilterSqlQueryProvider();
provider.ProcessGroup(e.ExpressionRoot);
//the filter expressions are contained in provider.Result
}
I hope this helps.
All the best,
Mira
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

thank you for your response.
scanario is this, my radgrid is bound by the ORM datasource. and attached to radfilter (rfGridFilter here in my code) through its
FilterContainerID property.
a date field also contained in orm datasource and displayed in datagrid. now when radfilter is used with this date field and any wrong format is given in Radfilter generated datatextfield for date. and a button is clicked then below event is fired.
protected void rbApplyFilter_Click(object sender, EventArgs e)
{
rfGridFilter.FireApplyCommand();
rgModuleGrid.Rebind();
}
then this below mentioned error is occured on this code of line rfGridFilter.FireApplyCommand();
Telerik.OpenAccess.RT.sql.SQLException: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.ResultSetImp.next()
at OpenAccessRuntime.Relational.RelationalStorageManager.executeCount(RelationalCompiledQuery cq, Object[] param)
how can i sort out this problem.
Based on the supplied information, it is hard to determine what is causing the error.
Could you please send us the code blocks you use for getting the expression built by the RadFilter and for applying it to the datasource?
Thank you in advance for the cooperation.
Greetings,
Mira
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

I have a Radfilter. its FilterContainerID property refer to a grid. Grid is bound through ORM, two columns one are bound to Grid
suach as EmpName(string type) and JoiningDate (datetime type).
now we want to filter data through the Radfilter. i click Radfilter AddExpression button. then it shows two field such as
EmpName and JoinDate. when JoinDate is selected a DateTimePicker control is generated to enter the date.
I enter some character or other thing instead of a proper date in this DateTimePicker control.
then click a button and this event is fired--
protected void rbApplyFilter_Click(object sender, EventArgs e)
{
rfGridFilter.FireApplyCommand(); //exception occurs here
rgModuleGrid.Rebind();
}
Telerik.OpenAccess.RT.sql.SQLException: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.ResultSetImp.next()
at OpenAccessRuntime.Relational.RelationalStorageManager.executeCount(RelationalCompiledQuery cq, Object[] param)
on this code of line rfGridFilter.FireApplyCommand(); as u can see
my question is that is there any way before FireApplyCommand method that it could be checked
that any proper format date is entered or not in Radfilter generated Datetime picker control or not.
and message could be given to user
When an invalid date is entered in the RadDateTimePicker, its value automatically is set to 1/1/0001 12:00:00 AM (the minimal allowed date).
You can see how to access and modify the filter expression here.
I hope this helps.
Regards,
Mira
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

When using the RadFilterSqlQueryProvider and using a datetime field in the Radfilter the result of the provider.Result call is for example:
([date)] >= '23-11-2011 16:00:00')
For SQL however one expects:
([date)] >= CONVERT(DATETIME, '2011-11-23 16:00:00', 102))
This is probably causing the error mentioned by Bharat.
The other providers of the Radfilter also don't give a result that could be used in a where clause of an SQL statement. Do you have a solution to this?
One would expect that a custom sqlprovider (with base class RadFilterSqlQueryProvider) would be available for e.g. ms-sql and mysql.
Thanks
Piet

When using the RadFilterSqlQueryProvider and using a datetime field in the Radfilter the result of the provider.Result call is for example:
([date)] >= '23-11-2011 16:00:00')
For SQL however one expects:
([date)] >= CONVERT(DATETIME, '2011-11-23 16:00:00', 102))
This is probably causing the error mentioned by Bharat.
The other providers of the Radfilter also don't give a result that could be used in a where clause of an SQL statement. Do you have a solution to this?
One would expect that a custom sqlprovider (with base class RadFilterSqlQueryProvider) would be available for e.g. ms-sql and mysql.
Thanks
Piet

When using the RadFilterSqlQueryProvider and using a datetime field in the Radfilter the result of the provider.Result call is for example:
([date)] >= '23-11-2011 16:00:00')
For SQL however one expects:
([date)] >= CONVERT(DATETIME, '2011-11-23 16:00:00', 102))
This is probably causing the error mentioned by Bharat.
The other providers of the Radfilter also don't give a result that could be used in a where clause of an SQL statement. Do you have a solution to this?
One would expect that a custom sqlprovider (with base class RadFilterSqlQueryProvider) would be available for e.g. ms-sql and mysql.
Thanks
Piet
I have answered your post about the same issue in the How to get SQL statement from Radfilter forum thread.
In order to avoid duplicate posts, I suggest that we continue the communication in the other thread.
Best wishes,
Mira
the Telerik team