Based upon other conditions I need to change the value of a combobox inside a filter template on a grid. Since the combobox is treated as a on runtime control, I have no access to it on the code behind. How can I find the control and set the DataSourceID on the code behind? Below is the combobox definition.
<telerik:GridBoundColumn DataField="Name" HeaderText="Applicant Name"> |
<FilterTemplate> |
<telerik:RadComboBox ID="ddlApplicantName" AppendDataBoundItems="true" Width='190px' |
Skin='Office2007' MarkFirstMatch="true" AllowCustomText="true" runat="server" |
DataSourceID="CurrentPostingOtherName" DataTextField="Name" DataValueField="Name" |
OnClientSelectedIndexChanged="NameChange" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Name").CurrentFilterValue %>'> |
<Items> |
<telerik:RadComboBoxItem Text="All" /> |
</Items> |
</telerik:RadComboBox> |
<telerik:RadScriptBlock ID="RadScriptBlock4" runat="server"> |
<script type="text/javascript"> |
function NameChange(sender, args) { |
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>"); |
tableView.filter("Name", args.get_item().get_value(), "EqualTo"); |
} |
</script> |
</telerik:RadScriptBlock> |
</FilterTemplate> |
</telerik:GridBoundColumn> |