I followed this example to setup custom filtering in the Rad Grid: http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/filter-templates/defaultcs.aspx
This works, however when I pick an option it fails with this error:
0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'getElementsByClassName': object is null or undefined
The code (inside the filter as per the sample):
<telerik:GridBoundColumn UniqueName="Division" HeaderText="Division" DataField="Division.Division1" SortExpression="Division.Division1" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" ReadOnly="true">
<FilterTemplate>
<telerik:RadComboBox ID="RadComboBoxTitle" DataSourceID="edsDivision" DataValueField="DivisionID" DataTextField="Division1"
Height="200px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Division").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="TitleIndexChanged">
<Items>
<telerik:RadComboBoxItem Text="All" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function TitleIndexChanged(sender, args) {
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("DivisionID", args.get_item().get_value(), "EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
</telerik:GridBoundColumn>
Division ID is a Foreign Key on the main table I'm using...
<asp:EntityDataSource ID="edsDivision" runat="server" ConnectionString="name=ERPEntities" DefaultContainerName="ERPEntities"
EntitySetName="Divisions" EntityTypeFilter="Division" OrderBy="it.Division1"
EnableInsert="false" EnableUpdate="false" EnableDelete="false">
</asp:EntityDataSource>
args.get_item().get_value() = 3 in my example.
Line 476 of the Dynamic Javascipt is where it fails:
This works, however when I pick an option it fails with this error:
0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'getElementsByClassName': object is null or undefined
The code (inside the filter as per the sample):
<telerik:GridBoundColumn UniqueName="Division" HeaderText="Division" DataField="Division.Division1" SortExpression="Division.Division1" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" ReadOnly="true">
<FilterTemplate>
<telerik:RadComboBox ID="RadComboBoxTitle" DataSourceID="edsDivision" DataValueField="DivisionID" DataTextField="Division1"
Height="200px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Division").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="TitleIndexChanged">
<Items>
<telerik:RadComboBoxItem Text="All" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function TitleIndexChanged(sender, args) {
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("DivisionID", args.get_item().get_value(), "EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
</telerik:GridBoundColumn>
Division ID is a Foreign Key on the main table I'm using...
<asp:EntityDataSource ID="edsDivision" runat="server" ConnectionString="name=ERPEntities" DefaultContainerName="ERPEntities"
EntitySetName="Divisions" EntityTypeFilter="Division" OrderBy="it.Division1"
EnableInsert="false" EnableUpdate="false" EnableDelete="false">
</asp:EntityDataSource>
args.get_item().get_value() = 3 in my example.
Line 476 of the Dynamic Javascipt is where it fails:
},getElementByClassName:function(d,c,g){if(d.getElementsByClassName){return d.getElementsByClassName(c)[0];
We are using IE9 in Standard IE9 mode.
Chrome and Firefox fail silently while Firefox reports a "TypeError: d is null"
How do I fix?