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

[Solved] Filter OnItemCommand

2 Answers 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
cursive34
Top achievements
Rank 1
cursive34 asked on 26 May 2009, 07:23 PM

I am in the process of upgrading an older application that used the previous RADControls to use the ASP.NET AJAX Controls. I have a grid with 4 columns (many rows) and each column is a link button. When a link button is clicked i want to filter that column by whatever text the link button has. (many rows will have the same values). here is my old code for the ASP.NET controls and it worked fine:

here is one of my snippets from the RadGrid1_ItemCommand event (Fields/Columns changed for easy read):

if (e.CommandName = "FilterCol1")
{
GridDataItem 
item = (GridDataItem)e.Item;  
 
LinkButton lb = (LinkButton)item["Col1"].FindControl("btnCol1");  
string strFilter = lb.Text;  
 
rgBOM.MasterTableView.FilterExpression = "([COL1_DATAFIELD] LIKE \'" + strFilter + "%\') ";  
 
GridColumn column = RadGrid1.MasterTableView.GetColumnSafe("Col1");  
column.CurrentFilterFunction = GridKnownFunction.Contains;  
RadGrid1.Rebind(); 
}

i get an error on the rebind : Expression Expected

2 Answers, 1 is accepted

Sort by
0
cursive34
Top achievements
Rank 1
answered on 27 May 2009, 05:03 PM
setting EnableLinqExpressions = false works
0
Pavlina
Telerik team
answered on 28 May 2009, 06:10 AM
Hello Justin,

Indeed, I would suggest you to set EnableLinqExpressions to false to avoid this.

If further issues arise, do not hesitate to write us back.

Greetings,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
cursive34
Top achievements
Rank 1
Answers by
cursive34
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or