I have a RadGrid that has one detail table. Everything is working right except the filtering. I have setup a custom Filter Template for the column that uses a RadComboBox to present a list of possible values the column would hold:
I created a code behind handler that is fired when the RadComboBox's SelectedIndex changes:
The code behind fires yet no filtering takes place. I tried calling the Rebind() method of the detail table after the last line above and it does not help.
I also tried the following code:
| <telerik:GridBoundColumn DataField="ReconciledFlag" HeaderText="Reconciled Status" UniqueName="ReconciledFlag"> |
| <HeaderStyle Width="33%" /> |
| <ItemStyle Width="33%" /> |
| <FilterTemplate> |
| <telerik:RadComboBox runat="server" ID="cbClickActivityReconciledFlags" AutoPostBack="true" Skin="Hay" OnSelectedIndexChanged="CickActivityFilterType_SelectedIndexChanged"> |
| <Items> |
| <telerik:RadComboBoxItem Text="All" Value="All" /> |
| <telerik:RadComboBoxItem Text="Clicked" Value="Clicked" /> |
| <telerik:RadComboBoxItem Text="Paid" Value="Paid" /> |
| <telerik:RadComboBoxItem Text="Contested" Value="Contested" /> |
| <telerik:RadComboBoxItem Text="Archived" Value="Archived" /> |
| </Items> |
| </telerik:RadComboBox> |
| </FilterTemplate> |
| </telerik:GridBoundColumn> |
I created a code behind handler that is fired when the RadComboBox's SelectedIndex changes:
| protected void CickActivityFilterType_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e) |
| { |
| RadComboBox cbReconciliationTypes = (RadComboBox) sender; |
| string selectedFilterType = cbReconciliationTypes.SelectedItem.Text; |
| string filterExpression = "([ReconcilationFlag] = '" + selectedFilterType + "')"; |
| grdSponsoredLinks.MasterTableView.DetailTables[0].FilterExpression = filterExpression; |
| } |
The code behind fires yet no filtering takes place. I tried calling the Rebind() method of the detail table after the last line above and it does not help.
I also tried the following code:
| protected void CickActivityFilterType_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e) |
| { |
| RadComboBox cbReconciliationTypes = (RadComboBox) sender; |
| string selectedFilterType = cbReconciliationTypes.SelectedItem.Text; |
| GridFilteringItem filterItem = (GridFilteringItem) cbReconciliationTypes.NamingContainer; |
| filterItem.FireCommandEvent("Filter", new Pair("EqualTo", selectedFilterType)); |
| } |