Hello
i'm stuck with a simple example.
I have a RadGrid with multiple column avec ExcelFilter activated.
When in a column, you have data like 'test AND test' the Filter got no FilterExpression when you select this particular line in the filter with a tickbox.
If you use the Filter fonction normally (Contain) it work.
Here is a simple exemple.
Default.aspx :
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
</Scripts>
</telerik:RadScriptManager>
<div>
<telerik:RadGrid ID="GridFile" runat="server"
OnNeedDataSource="ContextGrid_NeedDataSource"
AllowSorting="true"
AllowFilteringByColumn="True"
FilterType="HeaderContext"
EnableHeaderContextMenu="true"
EnableHeaderContextFilterMenu="true"
OnFilterCheckListItemsRequested="RadGrid1_FilterCheckListItemsRequested"
FilterMenu-EnableRoundedCorners="false"
>
<MasterTableView AutoGenerateColumns="false" TableLayout="Auto">
<Columns>
<telerik:GridBoundColumn UniqueName="Creation" DataField="Creation" HeaderText="Creation" FilterCheckListEnableLoadOnDemand="true"/>
<telerik:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Name" FilterCheckListEnableLoadOnDemand="true"/>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</div>
</form>
</body>
</html>
And Defaults.aspx.cs
using System.Data;
using Telerik.Web.UI;
public partial class Default : System.Web.UI.Page
{
protected void ContextGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
DataTable table = new DataTable();
GridFile.DataSource = getTable();
}
protected void RadGrid1_FilterCheckListItemsRequested(object sender, GridFilterCheckListItemsRequestedEventArgs e)
{
string DataField = (e.Column as IGridDataColumn).GetActiveDataField();
DataTable table = getTable();
table.DefaultView.Sort = DataField + " asc";
e.ListBox.DataSource = table.DefaultView.ToTable(true, DataField);
e.ListBox.DataKeyField = DataField;
e.ListBox.DataTextField = DataField;
e.ListBox.DataValueField = DataField;
e.ListBox.DataBind();
}
protected DataTable getTable()
{
DataTable table = new DataTable();
table.Columns.Add("Creation", typeof(string));
table.Columns.Add("Name", typeof(string));
int i = 0;
for (i=0; i < 10; i++)
{
table.Rows.Add(
"Name " + i,
i + " The AND a test"
) ;
}
return table;
}
}
Selection and Error in the 2 captures.
Works with OR also.Any Clues ?
Thinks it's the same error like the quote.
Thanks a lot
Benjamin