http://www.telerik.com/help/aspnet-ajax/radgridfiltertemplate.html
I have a radcombobox in my fliter template.
the issue I have is once i select something in the dropdown and set the filter expression...the gid filters the recordsbut in the display my combobox does not show the selected value.
it defaults to the first item.
How can i retain the combobox selected value?
my grid column declaration:
<
telerik:GridTemplateColumn HeaderText="Name" UniqueName="RelType" HeaderStyle-Width="25%"
DataField="RelationType">
<FilterTemplate>
<telerik:RadComboBox ID="RadComboBoxRelatedContacts" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RadComboBoxRelatedContacts_SelectedIndexChanged">
<Items>
<telerik:RadComboBoxItem Text="Family" Value="Family" />
<telerik:RadComboBoxItem Text="Business" Value="Business" />
<telerik:RadComboBoxItem Text="Personal" Value="Personal" />
</Items>
</telerik:RadComboBox>
</FilterTemplate>
<ItemTemplate><asp:Label ID="Label1" runat="server" CssClass="label" Visible='<%# !Convert.IsDBNull(Eval("Relationship")) %>'><br /><b>Relationship</b>: </asp:Label><%# Eval("Relationship")%>
<asp:Label ID="Label2" runat="server" CssClass="label" Visible='<%# !Convert.IsDBNull(Eval("RelationType")) %>'><br /><b>Rel. Type</b>: </asp:Label><%# Eval("RelationType")%>
</ItemTemplate>
</telerik:GridTemplateColumn>
aspx.cs
protected
void RadComboBoxRelatedContacts_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
RadComboBox list = (RadComboBox)sender;
string filterExpression = "([RelationType] = '" + list.SelectedValue + "')";
GridFilteringItem item = (GridFilteringItem)list.NamingContainer;
RadGrid gridKeyRel = (RadGrid)item.NamingContainer.NamingContainer.NamingContainer;
gridKeyRel.MasterTableView.FilterExpression = filterExpression;
gridKeyRel.MasterTableView.Rebind();
}