(iif(Description == null, "", Description).ToString().Contains("2")) AND (CodeType = 2)
What is mean of "iif"?and if we can pass this filter to "SqlCommand where section"?
Telerik.Web.UI 2012.3.1205.45
Best Regards
1 Answer, 1 is accepted
0
Accepted
Andrey
Telerik team
answered on 18 Feb 2013, 07:02 AM
Hello,
IIF is also known as the triple operator it used to get shorter expression. It is equal to this:
if (Description == null)
{
return "";
}
else
{
return Description.ToString();
}
Whether you could pass this expression to the Where clause depends on the scenario. If you want to pass filter expression to the datasource it is wiser to set the EnableLinqExpressions property of RadGrid to false. This will generate basic SQL expressions. Why you need to pass these expressions manually to the datasource? RadGrid evaluates and passes the right expressions to the datasource for you.
All the best,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.