I have a RadGrid with some columns using filtering. The filters are RadComboBox and I need to pre-select a value in the combo box when the page loads using a QueryString value I am passing in. Here is my ASPX code. Please help, how do I get my filter preselected to the value I am passing in.
QueryString:
Request.QueryString["AssigneeFullName"]
ASPX:
<telerik:GridTemplateColumn DataField="AssigneeFullName" HeaderText="Assignee" UniqueName="AssigneeFullName"
SortExpression="AssigneeFullName" HeaderStyle-Width="130px">
<ItemTemplate>
<asp:Label ID="lblAssigneeFullName" runat="server" Text='<%#Eval("AssigneeFullName")%>'></asp:Label>
</ItemTemplate>
<HeaderStyle Font-Bold="True" Width="130px" HorizontalAlign="Center" Font-Names="Arial" />
<FilterTemplate>
<telerik:RadComboBox ID="RadComboBoxTitle" DataTextField="FullName" DataValueField="FullName"
OnSelectedIndexChanged="RadComboAssignee_SelectedIndexChanged" AppendDataBoundItems="true"
SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("AssigneeFullName").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="AssigneeIndexChanged" Width="120px"
DataSource="<%# ComboBoxAssignees() %>">
<Items>
<telerik:RadComboBoxItem Text="View All" Value="" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function AssigneeIndexChanged(sender, args) {
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("AssigneeFullName", args.get_item().get_value(), "EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
</telerik:GridTemplateColumn>
QueryString:
Request.QueryString["AssigneeFullName"]
ASPX:
<telerik:GridTemplateColumn DataField="AssigneeFullName" HeaderText="Assignee" UniqueName="AssigneeFullName"
SortExpression="AssigneeFullName" HeaderStyle-Width="130px">
<ItemTemplate>
<asp:Label ID="lblAssigneeFullName" runat="server" Text='<%#Eval("AssigneeFullName")%>'></asp:Label>
</ItemTemplate>
<HeaderStyle Font-Bold="True" Width="130px" HorizontalAlign="Center" Font-Names="Arial" />
<FilterTemplate>
<telerik:RadComboBox ID="RadComboBoxTitle" DataTextField="FullName" DataValueField="FullName"
OnSelectedIndexChanged="RadComboAssignee_SelectedIndexChanged" AppendDataBoundItems="true"
SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("AssigneeFullName").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="AssigneeIndexChanged" Width="120px"
DataSource="<%# ComboBoxAssignees() %>">
<Items>
<telerik:RadComboBoxItem Text="View All" Value="" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function AssigneeIndexChanged(sender, args) {
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("AssigneeFullName", args.get_item().get_value(), "EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
</telerik:GridTemplateColumn>