Hello. I am tring to get a grid to filter based on a drop down selection. I have this working fine, except when the page is loaded from a history point.
Below is one of the columns in the my grid. Note the Java script within the RadScriptBlock5.
When the use navigates away from the page, and returns to the page, using the history navigation
I get the following error:
This java script is wrapped in RadScriptBlock.
Any ideas how to resolve this?
Below is one of the columns in the my grid. Note the Java script within the RadScriptBlock5.
<telerik:GridTemplateColumn DataField="Sale Price" HeaderText="Price" SortExpression="Sale Price" UniqueName="SalePrice"> <FilterTemplate> <telerik:RadComboBox ID="RadComboBoxSalePrice" runat="server" AppendDataBoundItems="true" EnableScreenBoundaryDetection="false" ExpandDirection="Down" DataSourceID="SalePriceDataSource" DataTextField="Sale Price" DataValueField="Sale Price Numeric" Height="220px" MarkFirstMatch="true" NoWrap="True" OnClientDropDownOpening="OnClientItemsRequestedHandler" OnClientItemsRequested="OnClientItemsRequestedHandler" OnClientSelectedIndexChanged="SalePriceIndexChanged" SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("SalePrice").CurrentFilterValue%>' Sort="Ascending" SortCaseSensitive="False" Width="70px"> <Items> <telerik:RadComboBoxItem Text="All" /> </Items> </telerik:RadComboBox> <telerik:RadScriptBlock ID="RadScriptBlock5" runat="server"> <script type="text/javascript"> function SalePriceIndexChanged(sender, args) { var tableView = $find("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>"); tableView.filter("SalePrice", args.get_item().get_value(), "EqualTo"); } </script> </telerik:RadScriptBlock> <br /> <div style="height: 35px; margin-top: 5px;"> <asp:ImageButton runat="server" ID="btnClear" ImageUrl="~/images/used equipment clear button.gif" OnClick="btnClear_Click" /> </div> </FilterTemplate> <ItemTemplate> <%# Eval("Price Combo")%> </ItemTemplate> <ItemStyle HorizontalAlign="Right" Width="70px" /> <HeaderStyle HorizontalAlign="Right" Width="70px" /> </telerik:GridTemplateColumn>I get the following error:
Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; xs-ivyEL6bAur8;Cm8Afr; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E) Timestamp: Tue, 14 Jan 2014 19:35:52 UTC Message: 'SalePriceIndexChanged' is undefined Line: 247648215 Char: 5 Code: 0 This java script is wrapped in RadScriptBlock.
Any ideas how to resolve this?