Hello,
I am trying to apply a filter on initial load but continue to get an error. I have followed this example http://www.telerik.com/help/aspnet-ajax/grdapplyingdefaultfilteroninitialload.html which seems pretty simple but I get an error: "Expression expected",.. "Exception Details: System.Web.Query.Dynamic.ParseException: Expression expected". Any help would be great.
Thanks
I am trying to apply a filter on initial load but continue to get an error. I have followed this example http://www.telerik.com/help/aspnet-ajax/grdapplyingdefaultfilteroninitialload.html which seems pretty simple but I get an error: "Expression expected",.. "Exception Details: System.Web.Query.Dynamic.ParseException: Expression expected". Any help would be great.
Thanks
<%@ Page Title="" Language="C#" MasterPageFile="~/MBA/MBA.master" AutoEventWireup="true" CodeFile="ProgramMembers.aspx.cs" Inherits="MBA_ProgramMembers" %><%@ Register Src="../Controls/AddPersonModal.ascx" TagName="AddPersonModal" TagPrefix="uc1" %><asp:Content ID="Content1" ContentPlaceHolderID="NestedContent" runat="Server"> <script type="text/javascript"> function OpenPositionedWindow(oButton, url, windowName) { var oWnd = window.radopen(url, windowName); } function openRadWindow(HNUMBER) { var oWnd = window.open("StudentFolder.aspx?HNUMBER=" + HNUMBER, "RadWindow1", "WindowPopup", "width=400px, height=400px, resizable"); oWnd.center(); } </script> <div id="programMembersGrid"> <telerik:RadGrid ID="rgMBAProgramMembers" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" DataSourceID="ldsMBAProgramMembers" GridLines="None" CellSpacing="0" EnableLinqExpressions="false"> <ClientSettings> <Selecting AllowRowSelect="True" /> </ClientSettings> <MasterTableView AutoGenerateColumns="False" DataSourceID="ldsMBAProgramMembers" FilterExpression="([Active] = True)"> <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn DataField="HNUMBER" DataType="System.Int32" FilterControlAltText="Filter HNUMBER column" HeaderText="HNUMBER" SortExpression="HNUMBER" UniqueName="HNUMBER" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="BANNER_ID" FilterControlAltText="Filter BANNER_ID column" HeaderText="Anumber" SortExpression="BANNER_ID" UniqueName="BANNER_ID" AutoPostBackOnFilter="false" CurrentFilterFunction="equalto" FilterDelay="4000" ShowFilterIcon="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="FullName" FilterControlAltText="Filter FullName column" HeaderText="Name" SortExpression="FullName" UniqueName="FullName" AutoPostBackOnFilter="false" CurrentFilterFunction="Contains" FilterDelay="4000" FilterControlWidth="150" ShowFilterIcon="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ProgramName" FilterControlAltText="Filter ProgramName column" HeaderText="Program" SortExpression="ProgramName" UniqueName="ProgramName" AllowFiltering="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="MemberTypes" FilterControlAltText="Filter MemberTypes column" HeaderText="MemberTypes" SortExpression="MemberTypes" UniqueName="MemberTypes" AllowFiltering="false"> </telerik:GridBoundColumn> <telerik:GridCheckBoxColumn DataField="Active" DataType="System.Boolean" HeaderText="Active" UniqueName="Active" AutoPostBackOnFilter="true" ShowFilterIcon="false" AllowSorting="true" CurrentFilterFunction="EqualTo" CurrentFilterValue="True"> </telerik:GridCheckBoxColumn> <telerik:GridTemplateColumn ItemStyle-Width="20px" HeaderStyle-Width="20px" FooterStyle-Width="20px"> <ItemTemplate> <a href="#" onclick="openRadWindow('<%#DataBinder.Eval(Container.DataItem,"HNUMBER")%>'); return false;"> <asp:Image ID="iFolder" runat="server" ImageUrl="~/App_Themes/Huntsman/Grid/Folder.png" Style="border: none; border-width: 0" /></a> </ItemTemplate> <FilterTemplate> Show All <asp:ImageButton ID="btnShowAll" runat="server" ImageUrl="~/App_Themes/Huntsman/Grid/filterCancel.gif" AlternateText="Show All" ToolTip="Show All" OnClick="btnShowAll_Click" Style="vertical-align: middle" /> </FilterTemplate> </telerik:GridTemplateColumn> </Columns> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"> </EditColumn> </EditFormSettings> </MasterTableView> <FilterMenu EnableImageSprites="False"> </FilterMenu> <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"> </HeaderContextMenu> </telerik:RadGrid> </div> <telerik:RadWindowManager ID="RadWindowManager1" Width="1020px" Height="1170px" EnableShadow="true" VisibleOnPageLoad="true" RestrictionZoneID="folderContainer" runat="server"> </telerik:RadWindowManager> <asp:LinqDataSource ID="ldsMBAProgramMembers" runat="server" ContextTypeName="DAL.HuntsmanLinqDataContext" EntityTypeName="" TableName="vw_MBAProgramMembers"> </asp:LinqDataSource> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="rgMBAProgramMembers"> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="ldsMBAProgramMembers"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="rgMBAProgramMembers" /> <telerik:AjaxUpdatedControl ControlID="ldsMBAProgramMembers" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager></asp:Content>-----------------------------------------------------------------------------------------------------------------------------------using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using Telerik.Web.UI;public partial class MBA_ProgramMembers : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { } protected void btnShowAll_Click(object sender, System.Web.UI.ImageClickEventArgs e) { rgMBAProgramMembers.MasterTableView.FilterExpression = string.Empty; foreach (GridColumn column in rgMBAProgramMembers.MasterTableView.RenderColumns) { if (column is GridBoundColumn) { GridBoundColumn boundColumn = column as GridBoundColumn; boundColumn.CurrentFilterValue = string.Empty; } } this. rgMBAProgramMembers.MasterTableView.Rebind(); }}