Hi,
I am using RadGrid with RadFilter. Everything works fine, after I select some data to filter and apply the filter if I close the browser after that I get the "Microsoft JScript runtime error: '_events' is null or not an object" error somewhere in Telerix.web.ui
aspx file:
cs code:
Please advise what is wrong here.
Thanks,
Reena
I am using RadGrid with RadFilter. Everything works fine, after I select some data to filter and apply the filter if I close the browser after that I get the "Microsoft JScript runtime error: '_events' is null or not an object" error somewhere in Telerix.web.ui
aspx file:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default14.aspx.cs" Inherits="Default14" %> <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <telerik:RadScriptBlock runat="server" ID="RadScriptBlock1"> <script type="text/javascript"> // function openFilterBuilderDialog() { $find('<%=RadWindow1.ClientID %>').show(); } function hideFilterBuilderDialog() { $find('<%=RadWindow1.ClientID %>').close(); } function OnHeaderMenuItemClicked(sender, args) { if (args.get_item().get_value() == "FilterBuilder") { openFilterBuilderDialog(); } } function onPanelBarItemClicked(sender, args) { if (args.get_item().get_commandName() == "OpenRadFilter") { openFilterBuilderDialog(); } } </script> </telerik:RadScriptBlock> </head> <body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <asp:Button ID="Button1" runat="server" Text="Refresh" OnClick="Button1_Click" /> <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadFilter1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadFilter1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="ApplyButton"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadGrid1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" /> <telerik:RadWindow ID="RadWindow1" runat="server" Behaviors="Move,Close,Resize" Title="Filter Builder" Modal="true" Width="500" Height="350"> <ContentTemplate> <telerik:RadFilter runat="server" ID="RadFilter1" FilterContainerID="RadGrid1" ShowApplyButton="false" style="margin:10px 0 0 10px"/> <asp:Panel ID="FilterButtonPanel" runat="server" style="margin:10px 0 0 10px;font-size:medium"> <asp:LinkButton runat="server" ID="ApplyButton" OnClick="ApplyButton_Click" Font-Names="Verdana" Font-Size="Small" Text="Apply Expressions" OnClientClick="hideFilterBuilderDialog()"/> </asp:Panel> </ContentTemplate> </telerik:RadWindow> <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true" PageSize="5" AllowSorting="true" OnItemCommand="RadGrid1_ItemCommand" AllowFilteringByColumn="True"> <MasterTableView AutoGenerateColumns="false" DataKeyNames="ID" IsFilterItemExpanded ="false" CommandItemDisplay="Top"> <CommandItemTemplate> <telerik:RadToolBar runat="server" ID="RadToolBar1" OnClientButtonClicked="onPanelBarItemClicked"> <Items> <telerik:RadToolBarButton Text="Show filter" CommandName="OpenRadFilter" ImageUrl="<%#GetFilterIcon() %>" ImagePosition="Right"/> </Items> </telerik:RadToolBar> </CommandItemTemplate> <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings> <PagerStyle Mode="NumericPages" /> <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings> <Columns> <telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID" ReadOnly="true" HeaderButtonType="None"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description"> </telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid> </form> </body> </html> cs code:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Telerik.Web.UI; using System.Data; using System.Collections; public partial class Default14 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { RadGrid1.DataSource = Data ; RadGrid1.DataBind(); } protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == RadGrid.PageCommandName) { e.Item.OwnerTableView.CurrentPageIndex = (e as GridPageChangedEventArgs).NewPageIndex; RadGrid1.DataSource = Data; RadGrid1.DataBind(); } if (e.CommandName == RadGrid.SortCommandName) { RadGrid1.DataSource = Data ; RadGrid1.DataBind(); } } public DataTable Data { get { if (Session["Data"] == null) { DataTable table = new DataTable(); table.Columns.Add("ID"); table.Columns.Add("Description"); for (int i = 0; i < 10; i++) { table.Rows.Add(i, "Description" + i.ToString()); } Session["Data"] = table; } return (DataTable)Session["Data"]; } set { Session["Data"] = value; } } protected string GetFilterIcon() { //RadGrid1.Skin = RadSkinManager1.Skin ; //RadGrid1.Rebind(); return RadAjaxLoadingPanel.GetWebResourceUrl(Page, string.Format("Telerik.Web.UI.Skins.{0}.Grid.Filter.gif", "Vista")); } protected void ApplyButton_Click(object sender, EventArgs e) { RadFilter1.FireApplyCommand(); RadGrid1.DataSource = Data ; RadGrid1.Rebind(); } }Please advise what is wrong here.
Thanks,
Reena