This is a migrated thread and some comments may be shown as answers.

Sys.InvalidOperationException: Handler was not added through the Sys.UI.DomEvent.addHandler method

5 Answers 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
akshya
Top achievements
Rank 1
akshya asked on 05 Dec 2008, 03:36 PM
Hello

i am getting this "Sys.InvalidOperationException: Handler was not added through the Sys.UI.DomEvent.addHandler method"
 javascript error.when scrolling the the scrollbar of radgird for ajax. please give a look of the code

 

<telerik:RadCodeBlock ID="rcb" runat="server">  

 

<script type="text/javascript">  

 

var loadedMoreRecords = false;  

 

 

function HandleScrolling(e)

 {

 

 

var grid = $find("<%=gdPropertyList.ClientID %>");   

 

 

var scrollArea = document.getElementById("<%=gdPropertyList.ClientID%>" + "_GridData");  

 

 

var totalRecords=<%=totalPropertiesCount %>;  

 

 

if(IsScrolledToBottom(scrollArea))  

{

loadedMoreRecords =

true;  

 

 

var currentlyDisplayedRecords = grid.get_masterTableView().get_pageSize() * (grid.get_masterTableView().get_currentPageIndex() + 1);

 

//if the presently visible items are less than the entire source records count  

 

//trigger an ajax request to increase them  

 

if(currentlyDisplayedRecords < totalRecords)  

{

$find(

"<%=radAjaxManger.ClientID %>").ajaxRequest("LoadMoreRecords"); }

 

 

else  

 

 

{loadedMoreRecords =

false;  }}

 

 

//this method calculates whether you have reached the bottom when dragging the vertical grid scroll

 

 

function IsScrolledToBottom(scrollArea)  

 

 

var currentPosition = scrollArea.scrollTop + scrollArea.clientHeight;  

 

 

return loadedMoreRecords ? false :(currentPosition == scrollArea.scrollHeight); 

}

</

script

 

 

</telerik:RadCodeBlock>
<telerik:RadAjaxManager ID="radAjaxManger" EnableAJAX="true" runat="server" OnAjaxRequest="radAjaxManger_AjaxRequest">

 

<ajaxsettings 

 

 

<telerik:AjaxSetting AjaxControlID="radAjaxManger">  

 

 

<UpdatedControls 

 

 

<telerik:AjaxUpdatedControl ControlID="gdPropertyList" LoadingPanelID="radAjaxLoadPnl" />  

 

 

</UpdatedControls 

 

 

</telerik:AjaxSetting> </ajaxsettings 

 

 

</telerik:RadAjaxManager> 

<

telerik:RadAjaxLoadingPanel ID="radAjaxLoadPnl" runat="server" MinDisplayTime="20" Transparency="25">  

 

 

<img style="margin-top: 250px" alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>style="border: 0;" />  

 

 

</telerik:RadAjaxLoadingPanel> 

 

 

<telerik:RadGrid ID="gdPropertyList" EnableEmbeddedSkins="false" Width="100%" OnItemDataBound="gdPropertyList_ItemDataBound"PagerStyle-BorderWidth="0" runat="server" GridLines="None" ShowHeader="False" OnNeedDataSource="gdPropertyList_NeedDataSource" Skin="" AllowPaging="True" PageSize="10" 

 

 

AutoGenerateColumns="False" EnableEmbeddedBaseStylesheet="False" EnableTheming="False" GroupingEnabled="False" ShowDesignTimeSmartTagMessage="False"> <mastertableview tablelayout="Fixed"> 
<Columns 

 

 

<telerik:GridBoundColumn DataField="ListingRKey" UniqueName="Id" Visible="false">  

 

 

</telerik:GridBoundColumn 

 

 

<telerik:GridTemplateColumn<ItemTemplate 

 

 

<div id="listviewdiv" class="msnprop listpageborder"> 

 

 

<img id="viewImg" style="vertical-align: bottom;" visible="false" runat="server" src="include/images/checkedImage.gif" alt="View the property" /> 
<%# string.Concat("&pound;",Convert.ToDecimal(Eval("Price")).ToString("N"))%>&nbsp;<%# Eval("Road")%>, 
<%
# Eval("[SecSubdiv]")%> <%# !string.IsNullOrEmpty(Eval("SecSubdiv").ToString()) ? "," : ""%> <%# Eval("[Postcode]")%</span>
div class="msnprop listdetailsDiv">

 

<span style="color: #4582b0; font-size: 13px; font-weight: bold"> <%#((int)Eval("Bedrooms")!=0 )?"<img alt='beds' onload='fixPNG(this)' src='"+ string.Concat( ReadConfiguration.ImagesPath,"bedIcon.png")+"'/>&nbsp;"+ Eval("Bedrooms") +"&nbsp;&nbsp;" : ""%>

 <

%#((int)Eval("Bathrooms") != 0) ? "<img alt='bathrooms' onload='fixPNG(this)' src='" + string.Concat(  

 

 

ReadConfiguration.ImagesPath,"bathIcon.png")+"'/>&nbsp;"+ Eval("Bathrooms") +"&nbsp;&nbsp;" : ""%>  

 

 

</span><span style="color: #333;">  

<%

# Eval("Description")%> </span>

 

 

</ItemTemplate</telerik:GridTemplateColumn</Columns</mastertableview<validationsettings enablevalidation="False" />  

 

 

<pagerstyle visible="False" /> 

 

 

<clientsettings enablepostbackonrowclick="false" allowexpandcollapse="False" allowgroupexpandcollapse="False">  

 

 

<Scrolling AllowScroll="true" SaveScrollPosition="true" ScrollHeight="778px" /> <Selecting EnableDragToSelectRows="False" />

 

<ClientEvents OnScroll="HandleScrolling" /> <Resizing ClipCellContentOnResize="False" /> </clientsettings</telerik:RadGrid 

 

 

 

pleae provide a solution as soon as possible we have to deploy the code .

 

 

 

 

 

 

5 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 08 Dec 2008, 02:43 PM
Hello akshya,

I see that you are using the approach presented in this online demo of RadGrid for ASP.NET AJAX (the second grid instance). Does this example work as expected under IE and FireFox on your machine? Additionally, can you please verify that you are using the latest version 2008.3.1125 of RadControls for ASP.NET AJAX in your project?

If you are unable to solve the issue yourself, please provide a live url where it can be observed or prepare a stripped working version of your project, exhibiting the erratic behavior, and send it attached to a regular support ticket. I will examine it in detail and will get back to you with my findings.

Best regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.

0
akshya
Top achievements
Rank 1
answered on 08 Dec 2008, 03:01 PM
Hello Sebastian
currently we are using "2008.2.723.20" version of telerik .Please provide the support as soon as possible.

Thanks and regards
Akshya kumar
0
Sebastian
Telerik team
answered on 08 Dec 2008, 03:04 PM
Hi akshya,

Can you provide answers to my previous questions in order to proceed further in our investigation? Furthermore, your account indicates that you are using a trial version of RadControls for ASP.NET AJAX, hence migrating to the latest release following the instructions from here should not be a problem for you.

Regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
akshya
Top achievements
Rank 1
answered on 08 Dec 2008, 03:45 PM
Hello
I am a employee of Microsoft company. so we are using these controls on company account not on my account. Now i am going to download "2008.3.1125.20" this version . Is this okay. still we have only this one.

Thanks and regards
akshay kumar
0
akshya
Top achievements
Rank 1
answered on 08 Dec 2008, 03:48 PM
Hello

I have used "2008.3.1125.20" version of Telerik controls. But still its working very slow on IE and does not fire onScroll event of grid on firefox browser 2nd time. First time when i scroll down it works fine but 2nd time it does not fire event.

Thanks and Regards
Akshya kumar
Tags
Grid
Asked by
akshya
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
akshya
Top achievements
Rank 1
Share this question
or