Trying to use a RadSearchBox in a FilterTemplate while using OpenAccess (I believe using simple binding?) - not sure how to get the filtering to work/in code behind - looked at several samples/demos - but none seem to show how or if it will work when using OpenAccess (trying to stick with simple binding if possible)
Test code below
<telerik:RadGrid ID="RadGridResults" runat="server" AutoGenerateColumns="False" CellSpacing="0" DataSourceID="OpenAccessLinqDataSource" GridLines="None" AllowPaging="True" AllowSorting="True" EnableLinqExpressions="False" AllowFilteringByColumn="True"> <ClientSettings> <Scrolling AllowScroll="True" UseStaticHeaders="True" /> </ClientSettings> <MasterTableView DataKeyNames="ProductID" DataSourceID="OpenAccessLinqDataSource1"> <Columns> <telerik:GridBoundColumn DataField="ProductRef" FilterControlAltText="Filter Product Ref column" HeaderText="ProductRef" SortExpression="ProductRef" UniqueName="ProductRef"> </telerik:GridBoundColumn> <telerik:GridDropDownColumn FilterControlAltText="Filter Brand Name column" UniqueName="ProductBrandName" DataSourceID="OpenAccessLinqDataSourceBrandName" DataField="ProductBrandNameID" HeaderText="Brand Name" SortExpression="CompanyName" ListValueField="CompanyID" AllowSorting="true" ListTextField="CompanyName" DropDownControlType="DropDownList"> <FilterTemplate> <telerik:RadSearchBox ID="RadSearchBox1" runat="server" DataSourceID="OpenAccessLinqDataSourceBrandName" DataTextField="CompanyName" DataValueField="CompanyID" ShowSearchButton="False" OnSearch="RadSearchBox1_Search"> </telerik:RadSearchBox> </FilterTemplate> </telerik:GridDropDownColumn>Tried using code below but DataBind() causes error 'Expression Expected' - have set 'EnableLinqExpressions=False' - as per other threads/samples
Protected Sub RadSearchBox1_Search(sender As Object, e As SearchBoxEventArgs) RadGridResults.MasterTableView.FilterExpression = "([ProductBrandName] = " + e.Text + ")" Dim column As GridColumn = RadGridResults.MasterTableView.GetColumnSafe("ProductBrandName") column.CurrentFilterFunction = GridKnownFunction.EqualTo column.CurrentFilterValue = e.Text RadGridResults.DataBind() End Sub