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

FilterExpression on Initial Page Load

3 Answers 60 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tommy
Top achievements
Rank 1
Tommy asked on 10 Jun 2010, 10:12 AM
Hello,

I've created a Gridview strictly for as a user maitenance page. I'm trying to get one of the columns so that it automatically filters the disabled column to 'N'. I've looked through all the tutorials and documentation and followed them exactly. I'm still receiving an error out of know where. Can anyone help me with this? Here is my code.

.cs

 

protected void RadGrid1_PreRender(object sender, System.EventArgs e)

 

{

 

if (!Page.IsPostBack)

 

{

RadGrid1.MasterTableView.FilterExpression =

"([disabled_ind] LIKE \'%N%\')";

 

 

GridColumn column = RadGrid1.MasterTableView.GetColumnSafe("disabled_ind");

 

column.CurrentFilterFunction =

GridKnownFunction.Contains;

 

column.CurrentFilterValue =

"N";

 

RadGrid1.MasterTableView.Rebind();
}

}
I'm using a SqlDataSource didn't know if this might be an issue. Any help would be greatly appreciated because I keep getting the error "Expression needed" when its exactly as the documentation and tutorials say.

3 Answers, 1 is accepted

Sort by
0
Tommy
Top achievements
Rank 1
answered on 10 Jun 2010, 11:07 AM
Still having an issue with this... does anyone have any ideas?
0
Accepted
Shinu
Top achievements
Rank 2
answered on 10 Jun 2010, 11:53 AM
Hello Tommy,

Set EnableLinqExpressions property of the grid to false and see whether this eliminates the exception.

Regards,
Shinu.  

 
0
Tommy
Top achievements
Rank 1
answered on 10 Jun 2010, 11:56 AM
Thanks Shinu, that worked! It was starting to drive me insane!
Tags
Grid
Asked by
Tommy
Top achievements
Rank 1
Answers by
Tommy
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or