
Anup Kagalkar
Top achievements
Rank 1
Anup Kagalkar
asked on 19 Aug 2010, 08:09 AM
Hi
I have created custom template column for filtering . Given below is code of MyCustomFilteringTemplateColumn.cs. I m using Entity datasource
//RadGrid will cal this method when the value should be set to the filtering input control(s)
I have created custom template column for filtering . Given below is code of MyCustomFilteringTemplateColumn.cs. I m using Entity datasource
//RadGrid will cal this method when the value should be set to the filtering input control(s)
protected override void SetCurrentFilterValueToControl(TableCell cell)
{
base.SetCurrentFilterValueToControl(cell);
RadComboBox combo = (RadComboBox)cell.Controls[0];
if ((this.CurrentFilterValue != string.Empty))
{
combo.Text = this.CurrentFilterValue;
}
}
//RadGrid will cal this method when the filtering value should be extracted from the filtering input control(s)
protected override string GetCurrentFilterValueFromControl(TableCell cell)
{
RadComboBox combo = (RadComboBox)cell.Controls[0];
this.CurrentFilterFunction = (combo.Text.Trim() != "") ? GridKnownFunction.EqualTo : GridKnownFunction.NoFilter;
return combo.Text;
}
private void list_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
{
Collection<Entities.ProjectUsersAndGroups> collDataSource = (Collection<Entities.ProjectUsersAndGroups>)FilterDataSource;
((RadComboBox)o).DataTextField = this.DataField;
((RadComboBox)o).DataValueField = this.DataField;
((RadComboBox)o).DataSource = collDataSource;
((RadComboBox)o).DataBind();
break;
}
private void list_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
{
GridFilteringItem filterItem = (GridFilteringItem)((RadComboBox)o).NamingContainer;
if ((this.UniqueName == "Index"))
{
//this is filtering for integer column type
filterItem.FireCommandEvent("Filter", new Pair("EqualTo", this.DataField));
}
//filtering for string column type
if (this.UniqueName == "ProjectCategoryName")
this.UniqueName = "ProjectCategoryDetails.ProjectCategoryName";
filterItem.FireCommandEvent("Filter", new Pair("Contains", this.DataField));
}
While filtering I am getting error "Expression expected " on this line filterItem.FireCommandEvent("Filter", new Pair("Contains", this.DataField));".
Please help me out
While filtering I am getting error "Expression expected " on this line filterItem.FireCommandEvent("Filter", new Pair("Contains", this.DataField));".
Please help me out
5 Answers, 1 is accepted
0
Hello Anup,
Try to set RadGrid EnableLinqExpressions property to false and let me know if it helps to eliminate the error message.
Sincerely yours,
Pavlina
the Telerik team
Try to set RadGrid EnableLinqExpressions property to false and let me know if it helps to eliminate the error message.
Sincerely yours,
Pavlina
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

Anup Kagalkar
Top achievements
Rank 1
answered on 19 Aug 2010, 04:10 PM
Error message is not coming but filtering is not happening
0
Hello Anup,
Could you please confirm that you have not override DataField property in your custom column?
All the best,
Pavlina
the Telerik team
Could you please confirm that you have not override DataField property in your custom column?
All the best,
Pavlina
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

Huy
Top achievements
Rank 1
answered on 26 Apr 2012, 07:37 AM
It works, Thanks so much.
0

Won
Top achievements
Rank 1
answered on 01 Nov 2012, 04:38 AM
This works even as of Oct, 2012. I'm using .net 4.
The document for this filtering should be updated accordingly.
http://www.telerik.com/help/aspnet-ajax/grid-google-like-filtering.html
The document for this filtering should be updated accordingly.
http://www.telerik.com/help/aspnet-ajax/grid-google-like-filtering.html