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

FilterTemplate + error

2 Answers 30 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tomasz
Top achievements
Rank 1
Tomasz asked on 07 Apr 2011, 08:38 PM

 

 

Hello I want to filter column in my grid with filtertempalte column including RadComboBox
the code look like this(i have already read the blogs and have seen the demos about filter template)

<
telerik:GridTemplateColumn DataField="Obraz" Visible="false" Resizable="false" UniqueName="TemplateColumn"

 

 

 

AllowFiltering="true">

 

 

 

<FilterTemplate>

 

 

 

<telerik:RadComboBox ID="ComboFilterBox" runat="server" AppendDataBoundItems="true" OnSelectedIndexChanged="FilterCombo_SelectedIndexChanged" DataTextField="Obraz" DataValueField="Obraz"

 

 

 

OnLoad="Combo_NeedDataSource" AutoPostBack="true">

 

 

 

<items>

 

 

 

<telerik:RadComboBoxItem />

 

 

 

</items>

 

 

 

</telerik:RadComboBox>

 

 

 

 

</FilterTemplate>

 

 

 

<ItemTemplate>

 

 

 

<asp:Image ID="Image1" runat="server" ImageUrl="<%# bind('Obraz') %>" ForeColor="White" />

 

 

 

</ItemTemplate>

 

 

 

<HeaderStyle Width="170" />

 

 

 

<ItemStyle Width="170px" />

 

 

 

</telerik:GridTemplateColumn>

and then in Code-Behind I have placed the function

 

 

protected

 

 

void FilterCombo_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)

 

 

{

 

 

 

 

string filterExpression;

 

 

filterExpression =

 

 

"([Obraz] = '" + e.Value + "')";

 

 

RadGrid1.MasterTableView.FilterExpression = filterExpression;

 

RadGrid1.MasterTableView.Rebind();

 

}

and then when I change the values in combobox i get the error
 Sys.WebForms.PageRequestManagerServerErrorException: Expression expected
after Rebind.
Please help.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 08 Apr 2011, 04:51 AM
Hello Thomasz,

Try to set EnableLinqExpressions property of RadGrid as 'false' and check whether this eliminates the exception.

Thanks,
Princy.
0
Tomasz
Top achievements
Rank 1
answered on 08 Apr 2011, 06:54 AM
Thank you, it's working now :)
Regards,
Tags
Grid
Asked by
Tomasz
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Tomasz
Top achievements
Rank 1
Share this question
or