I have a RadGrid on my page that I use as a selector, and via it's SelectedIndexChanged I wanna set some header filter on another grid.
Each time the selection is changed in the first RadGrid (rgPendingRequests) I want to adjust the header filter of rgResponsables and filter the result. The user must then be able to change the header filter as he wish, in case the filter returns nothing.
This is the grid I wanna apply the header filter to
<telerik:RadGrid ID="rgResponsables" runat="server" Width="100%" Height="220px" AutoGenerateColumns="False" EnableViewState="true" AllowFilteringByColumn="True" AllowSorting="True" CssClass="gridPartageResponsables" EnableLinqExpressions="false"> <GroupingSettings CaseSensitive="false"></GroupingSettings> <ClientSettings EnableRowHoverStyle="true" Selecting-AllowRowSelect="true" EnablePostBackOnRowClick="true" Scrolling-UseStaticHeaders="true" /> <MasterTableView DataKeyNames="ResponsableID" AllowFilteringByColumn="True" > <Columns> <telerik:GridBoundColumn DataField="Prenom" Visible="true" HeaderStyle-Font-Bold="true" HeaderText="Prénom" UniqueName="Prenom" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" /> <telerik:GridBoundColumn DataField="Nom" Visible="true" HeaderStyle-Font-Bold="true" HeaderText="Nom" UniqueName="Nom" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" /> <telerik:GridBoundColumn DataField="Courriel" Visible="true" HeaderStyle-Width="250px" HeaderStyle-Font-Bold="true" HeaderText="Courriel" UniqueName="Courriel" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" /> <telerik:GridBoundColumn DataField="Telephone" Visible="true" HeaderStyle-Width="120px" HeaderStyle-Font-Bold="true" HeaderText="Téléphone" UniqueName="Telephone" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" /> </Columns> </MasterTableView></telerik:RadGrid>Here is my code Behind:
Protected Sub rgPendingRequests_SelectedIndexChanged(sender As Object, e As EventArgs) _Handles rgPendingRequests.SelectedIndexChanged Dim PrenomCol = rgResponsables.MasterTableView.GetColumnSafe("Prenom") PrenomCol.CurrentFilterFunction = GridKnownFunction.Contains PrenomCol.CurrentFilterValue = rgPendingRequests.SelectedValues("FirstName") Dim NomCol = rgResponsables.MasterTableView.GetColumnSafe("Nom") NomCol.CurrentFilterFunction = GridKnownFunction.Contains NomCol.CurrentFilterValue = rgPendingRequests.SelectedValues("LastName") rgResponsables.Rebind() End SubBut even though the values appear in the header filter, the table is not filtered until I go to a header filter field and press enter...
I've tried everything I can think of, and could not make it work...
I could really use some pointer on what I'm doing wrong...
