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("£",Convert.ToDecimal(Eval("Price")).ToString("N"))%> <%# 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")+"'/> "+ Eval("Bedrooms") +" " : ""%>
<
%#((int)Eval("Bathrooms") != 0) ? "<img alt='bathrooms' onload='fixPNG(this)' src='" + string.Concat(
ReadConfiguration.ImagesPath,"bathIcon.png")+"'/> "+ Eval("Bathrooms") +" " : ""%>
</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 .