
Microsoft JScript runtime error: Sys.InvalidOperationException: Handler was not added through the Sys.UI.DomEvent.addHandler method
The code are follows.
<telerik:RadAjaxManager ID="rdAjaxManagerHistoryGrid" runat="server" EnableAJAX="true" DefaultLoadingPanelID="LoadingPnlCustom" >
<ajaxsettings>
<telerik:AjaxSetting AjaxControlID="rGridHistories">
<updatedcontrols>
<telerik:AjaxUpdatedControl ControlID="rGridHistories"
LoadingPanelID="LoadingPnlCustom" /></updatedcontrols></telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="btnRefreshHistory">
<updatedcontrols>
<telerik:AjaxUpdatedControl ControlID="rGridHistories"
LoadingPanelID="LoadingPnlCustom" /></updatedcontrols></telerik:AjaxSetting>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="LoadingPnlCustom" runat="server"
BackColor="control" Transparency="15">
<asp:Image ID="imgCustom" runat="server"
ImageUrl="~/images/loadingFinal.gif" />
</telerik:RadAjaxLoadingPanel>
<telerik:RadGrid ID="rgridHistories1" runat="server" Visible="false"
AllowAutomaticDeletes="True" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" BorderColor="AntiqueWhite"
ClientSettings-EnableClientKeyValues="true"
GridLines="None" Height="349px"
LoadingTemplateTransparency="15" PageSize="20" ShowStatusBar="True"
skin="Outlook" Width="91%">
<mastertableview clientdatakeynames="UniqueId,UserName"
DataKeyNames="UniqueId,UserName" editmode="InPlace" gridlines="Both">
<parenttablerelation>
<telerik:GridRelationFields />
</parenttablerelation>
<rowindicatorcolumn visible="False">
<HeaderStyle Width="20px" />
</rowindicatorcolumn>
<expandcollapsecolumn resizable="False" visible="False">
<HeaderStyle Width="20px" />
</expandcollapsecolumn>
<Columns>
<telerik:GridBoundColumn DataField="Uniqueid" HeaderText="UniqueId"
ReadOnly="True" UniqueName="Uniqueid" Visible="False">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn AutoPostBackOnFilter="True"
ColumnEditorID="chkHistoryReviewedID" DataType="System.Boolean"
HeaderText="Reviewed" UniqueName="Reviewed">
<ItemTemplate>
<asp:CheckBox ID="chkHistory" runat="server" AutoPostBack="True"
Checked="false" OnCheckedChanged="History_CheckBox_Check" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="EditHistory"
HeaderText="Edit" ImageUrl="~/images/ico_16_customEntity.gif"
Text="Update History" UniqueName="EditColumn">
</telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField="ManagerNotes" HeaderText="Manager Note"
UniqueName="ManagerNotes" Visible="False">
<ItemStyle Font-Bold="False" Font-Italic="False" Font-Names="Verdana"
Font-Overline="False" Font-Size="X-Small" Font-Strikeout="False"
Font-Underline="False" ForeColor="DarkGray" HorizontalAlign="Center"
Wrap="True" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="UserName" HeaderText="User" ReadOnly="True"
UniqueName="UserName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Subject" HeaderText="Subject"
ReadOnly="True" UniqueName="Subject">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="RecordedForUserUniqueId"
HeaderText="Recorded For User Unique ID"
ReadOnly="True" UniqueName="UserUniqueId" Visible="False">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="RecordedwithContactUniqueId"
Display="False"
HeaderText="Recorded with Contact Unique ID"
ReadOnly="True" UniqueName="ContactUniqueID">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Company" HeaderText="Company"
ReadOnly="True" UniqueName="Company">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ContactName" HeaderText="Contact Name"
ReadOnly="True" UniqueName="ContactName">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="HType" HeaderText="Type" ReadOnly="True"
UniqueName="Type">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Notes" HeaderText="Details" ReadOnly="True"
UniqueName="Details">
<HeaderStyle Width="150px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="RecordedTime" HeaderText="Recorded Time"
ReadOnly="True" UniqueName="RecordedDate">
</telerik:GridBoundColumn>
<telerik:GridHyperLinkColumn HeaderText="Attachment"
UniqueName="AttachmentColumn">
</telerik:GridHyperLinkColumn>
</Columns>
<editformsettings>
<editcolumn autopostbackonfilter="True" uniquename="EditCommandColumn1">
</editcolumn>
</editformsettings>
</mastertableview>
<clientsettings allowcolumnsreorder="True">
<selecting allowrowselect="True" />
<scrolling allowscroll="True" usestaticheaders="True" /></clientsettings>
<PagerStyle Mode="NextPrevAndNumeric" Position="Top"
PrevPageText="&lt; " /><EditItemStyle BorderColor="#C0C0FF"
BorderStyle="Inset" Font-Bold="False" Font-Italic="False" Font-Overline="False"
Font-Strikeout="False" Font-Underline="False" Wrap="True" />
<SelectedItemStyle BackColor="LightGray" Font-Bold="False"
Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" Wrap="True" /></telerik:RadGrid>
| <telerik:RadWindowManager ID="radWindowManager" runat="server" Skin="Web20" style="z-index: 90000;"> |
| <Windows> |
| <telerik:RadWindow ID="radWindowAbout" runat="server" Animation="FlyIn" Overlay="True" KeepInScreenBounds="True" Behavior="Default" InitialBehavior="None" Left="" |
| NavigateUrl="Dialogs/About.aspx" Style="display: none;" Top=""> |
| </telerik:RadWindow> |
| </Windows> |
| </telerik:RadWindowManager> |
| <div id="ctl00_ctl00_ContentPlaceHolder_radWindowManagerPanel"> |
| <div id="ctl00_ContentPlaceHolder_radWindowManager" style="z-index:90000;display:none;"> |
| <div id="ctl00_ContentPlaceHolder_radWindowAbout" style="display:none;"> |
| <input id="ctl00_ContentPlaceHolder_radWindowAbout_ClientState" name="ctl00_ContentPlaceHolder_radWindowAbout_ClientState" type="hidden" /> |
| </div><div id="ctl00_ContentPlaceHolder_radWindowManager_alerttemplate" style="display:none;"> |
| <div class="windowpopup radalert"> |
| <div class="dialogtext"> |
| {1} |
| </div> |
| <div> |
| <a onclick="$find('{0}').close();" |
| class="radwindowbutton" href="javascript:void(0);"> |
| <span class="outerspan"> |
| <span class="innerspan">##LOC[OK]##</span> |
| </span> |
| </a> |
| </div> |
| </div> |
| </div><div id="ctl00_ContentPlaceHolder_radWindowManager_prompttemplate" originalAttribute="href" originalPath="javascript:void(0);"> |
| <span class="outerspan"> |
| <span class="innerspan">##LOC[OK]##</span> |
| </span> |
| </a> |
| </div> |
| </div> |
| </div><div id="ctl00_ContentPlaceHolder_radWindowManager_prompttemplate" style="display:none;"> |
| <div class="windowpopup radprompt"> |
| <div class="dialogtext"> |
| {1} |
| </div> |
| <div> |
| <input type="text" class="dialoginput" value="{2}" /> |
| </div> |
| <div> |
| <a onclick="$find('{0}').callBack(this.parentNode.parentNode.getElementsByTagName('input')[0].value);" |
| class="radwindowbutton" href="javascript:void(0);" originalAttribute="href" originalPath="javascript:void(0);" ><span class="outerspan"><span class="innerspan">##LOC[OK]##</span></span></a> |
| <a onclick="$find('{0}').callBack('');" class="radwindowbutton" href="javascript:void(0);"><span class="outerspan"><span class="innerspan">##LOC[Cancel]##</span></span></a> |
| </div> |
| </div> |
| </div><div id="ctl00_ContentPlaceHolder_radWindowManager_confirmtemplate" originalAttribute="href" originalPath="javascript:void(0);"><span class="outerspan"><span class="innerspan">##LOC[Cancel]##</span></span></a> |
| </div> |
| </div> |
| </div><div id="ctl00_ContentPlaceHolder_radWindowManager_confirmtemplate" style="display:none;"> |
| <div class="windowpopup radconfirm"> |
| <div class="dialogtext"> |
| {1} |
| </div> |
| <div> |
| <a onclick="$find('{0}').callBack(true);" class="radwindowbutton" href="javascript:void(0);" originalAttribute="href" originalPath="javascript:void(0);" ><span class="outerspan"><span class="innerspan">##LOC[OK]##</span></span></a> |
| <a onclick="$find('{0}').callBack(false);" class="radwindowbutton" href="javascript:void(0);"><span class="outerspan"><span class="innerspan">##LOC[Cancel]##</span></span></a> |
| </div> |
| </div> |
| </div><input id="ctl00_ContentPlaceHolder_radWindowManager_ClientState" originalAttribute="href" originalPath="javascript:void(0);"><span class="outerspan"><span class="innerspan">##LOC[Cancel]##</span></span></a> |
| </div> |
| </div> |
| </div><input id="ctl00_ContentPlaceHolder_radWindowManager_ClientState" name="ctl00_ContentPlaceHolder_radWindowManager_ClientState" type="hidden" /> |
| </div> |
| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" %> |
| <%@ 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>Untitled Page</title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <asp:ScriptManager ID="ScriptManager1" runat="server" /> |
| <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /> |
| <br /> |
| <telerik:RadComboBox ID="ExportList" AutoPostBack="true" runat="server" |
| onselectedindexchanged="ExportList_SelectedIndexChanged"> |
| <Items> |
| <telerik:RadComboBoxItem Text="Export" Value="Export" runat="server"/> |
| <telerik:RadComboBoxItem Text="Export to Excel" Value="Excel" runat="server"/> |
| <telerik:RadComboBoxItem Text="Export to ExcelML" Visible="false" Value="ExcelML" runat="server"/> |
| <telerik:RadComboBoxItem Text="Export to Word" Value="Word" runat="server"/> |
| <telerik:RadComboBoxItem Text="Export to CSV" Value="CSV" runat="server"/> |
| <telerik:RadComboBoxItem Text="Export to PDF" Value="PDF" runat="server"/> |
| </Items> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </telerik:RadComboBox> |
| <br /> |
| <telerik:RadGrid ID="RadGrid1" GridLines="None" AllowSorting="true" runat="server"> |
| <MasterTableView DataKeyNames="CustomerID"> |
| <Columns> |
| <telerik:GridButtonColumn Text="Edit" HeaderText="Edit" CommandName="Select"> |
| </telerik:GridButtonColumn> |
| </Columns> |
| <ExpandCollapseColumn Visible="False"> |
| <HeaderStyle Width="19px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <RowIndicatorColumn Visible="True"> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| </MasterTableView> |
| <ClientSettings> |
| <Selecting AllowRowSelect="True" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| </form> |
| </body> |
| </html> |
| using System; |
| using System.Collections; |
| using System.Configuration; |
| using System.Data; |
| using System.Linq; |
| using System.Web; |
| using System.Web.Security; |
| using System.Web.UI; |
| using System.Web.UI.HtmlControls; |
| using System.Web.UI.WebControls; |
| using System.Web.UI.WebControls.WebParts; |
| using System.Xml.Linq; |
| public partial class Default4 : System.Web.UI.Page |
| { |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| } |
| protected void Button1_Click(object sender, EventArgs e) |
| { |
| DataClassesDataContext customers = new DataClassesDataContext(); |
| var query = from customer in customers.Customers |
| select new { customer.CustomerID, customer.ContactName, customer.Address, customer.City }; |
| RadGrid1.DataSource = query; |
| RadGrid1.DataBind(); |
| } |
| public void ConfigureExport(bool ExportOnlyData, bool IgnorePaging, bool OpenInNewWindow) |
| { |
| RadGrid1.ExportSettings.ExportOnlyData = ExportOnlyData; |
| RadGrid1.ExportSettings.IgnorePaging = IgnorePaging; |
| RadGrid1.ExportSettings.OpenInNewWindow = OpenInNewWindow; |
| RadGrid1.ExportSettings.FileName = "12345"; |
| } |
| public void ConfigureExport() |
| { |
| ConfigureExport(true, true, true); |
| } |
| protected void ExportList_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) |
| { |
| if (ExportList.SelectedIndex != 0) |
| { |
| switch (ExportList.SelectedValue) |
| { |
| case "Excel": |
| ConfigureExport(); |
| RadGrid1.MasterTableView.ExportToExcel(); |
| break; |
| case "ExcelML": |
| break; |
| case "Word": |
| ConfigureExport(); |
| RadGrid1.MasterTableView.ExportToWord(); |
| break; |
| case "CSV": |
| ConfigureExport(); |
| RadGrid1.MasterTableView.ExportToCSV(); |
| break; |
| case "PDF": |
| ConfigureExport(); |
| RadGrid1.ExportSettings.Pdf.AllowCopy = true; |
| RadGrid1.ExportSettings.Pdf.AllowModify = true; |
| RadGrid1.ExportSettings.Pdf.AllowPrinting = true; |
| RadGrid1.ExportSettings.Pdf.PaperSize = Telerik.Web.UI.GridPaperSize.Letter; |
| RadGrid1.MasterTableView.ExportToPdf(); |
| break; |
| default: |
| break; |
| } |
| } |
| } |
| } |