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

Get error on RadGrid filter. Sys.WebForms.PageRequestManagerServerErrorException: Expression expected

1 Answer 357 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alessio
Top achievements
Rank 1
Alessio asked on 19 Apr 2010, 12:25 PM
Hi, i've a problem with RadGrid filter.
I add columns runtime and all works fine unless i try to filter. When do this i got the exception...Here my code:
 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" /> 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"
        <telerik:RadGrid Width="100%" ID="RadGridUtenti" runat="server"  AllowFilteringByColumn="true"  
            OnSelectedIndexChanged="RadGridUtenti_SelectedIndexChanging" OnNeedDataSource="RadGridUtenti_NeedDataSource"
            <MasterTableView AllowPaging="true" TableLayout="Fixed" AllowFilteringByColumn="true" DataKeyNames="IdUtente" EditMode="InPlace" /> 
            <ClientSettings EnableRowHoverStyle="true" /> 
        </telerik:RadGrid> 
    </telerik:RadAjaxPanel> 
 
 
 
 protected void RadGridUtenti_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
    { 
        BindUtenti(); 
    } 
 
 
private void BindUtenti() 
    { 
RadGridUtenti.Columns.Clear(); 
 
        GridBoundColumn bf = new GridBoundColumn(); 
        //bf.DataField = "Username"
        bf.HeaderText = "Login"
        bf.ShowFilterIcon = false
        bf.CurrentFilterFunction = GridKnownFunction.Contains; 
        bf.AutoPostBackOnFilter = false
        bf.FilterDelay = 4000
        RadGridUtenti.Columns.Add(bf); 
 
RadGridUtenti.DataSource = gu.GetUtenti(); 
 
//Where gu.GetUtenti() return a List... 
 
 
 
 
 

Any suggestion?

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 20 Apr 2010, 08:04 AM
Hi Alessio,

Please set the EnableLinqExpressions for the grid instance to false in order to avoid this error. Additionally, to see how to construct the filter expression for the control, please refer to the following help article:

http://www.telerik.com/help/aspnet-ajax/grdoperatewithfilterexpression.html

the last section contains additional information on how to construct the expression.

Kind regards,
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.
Tags
Grid
Asked by
Alessio
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or