Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
123 views
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 .

 

 

 

 

 

 

akshya
Top achievements
Rank 1
 answered on 08 Dec 2008
1 answer
88 views
Morning Telerik Team,

I have a slight issue with the document manager in the Rad Editor.  I am setting the view, upload and delete paths to a folder within the application dynamically in code, this folder is a virtual directory pointing to a folder in the top level application.  The problem we have is that this application is nested within another application and because of this it wont allow access to the folder.  I am not sure if this is a Rad Control issue, but any advice on how we could get access to this virtual directory would help.

Thanks in advance
Ian
Nikolay Raykov
Telerik team
 answered on 08 Dec 2008
3 answers
110 views
Does the gannt support connectors? How?
Ves
Telerik team
 answered on 08 Dec 2008
1 answer
105 views
Hi everybody

I'm developing a application using Grids, the application permits to the users select the columns that will be showing, the user can save the "list" of visible columns and select any list and show it after.

The problem happens when I want to sort the visible columns (using the "display" property when is "true"), I have already read the information about the methods for reorder the columns as the swap or reorder methods, including using the OrderIndex property too, but I don't get to order ONLY the visible columns that the user ordered before exchanging the columns in a order desired.

I listen suggestions. Thank you


Sebastian
Telerik team
 answered on 08 Dec 2008
1 answer
69 views
I have a RadGrid with a user control for the edit form. The user control contains a RadDatePicker control. When the form is in add mode, everything works fine. When it is edit mode and and I click on the datepicker control, I receive a Microsoft JScript runtime error: Object expected error.
Georgi Krustev
Telerik team
 answered on 08 Dec 2008
2 answers
95 views
Hi All

At the moment I am adding some telerik:RadTreeViewContextMenu through hardcoding in the code, however I wish to add these Context Menus dynamically if possible, since I have about 10 different ones, and they are a bit cluncky on the aspx page.

How can I achieve this

Thanks for your help and time

Johann
Johann
Top achievements
Rank 1
 answered on 08 Dec 2008
1 answer
205 views
I'm required to use rdl or rdlc for my reports, so when presenting I use the Microsoft ReportViewer control as I believe that Telerik's ReportViewer does not support those extensions.  My problem is I have a checkboxlist that I need to populate based on a drop down list.  These controls are in RadMultiPage.  I've surrounded the two fields with a RadAjaxPanel.  When I run the page, it comes up correctly, the Ajax works in that I can populate the checkboxlist. But then when I press the button to build the report, I get the following error.

Specified argument was out of the range of valid values.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.]
   Microsoft.Reporting.WebForms.ReportViewer.set_CurrentPage(Int32 value) +137
   Microsoft.Reporting.WebForms.ReportViewer.ClientSidePageNumberChanged(Object sender, EventArgs e) +69
   System.Web.UI.WebControls.HiddenField.OnValueChanged(EventArgs e) +111
   System.Web.UI.WebControls.HiddenField.RaisePostDataChangedEvent() +31
   System.Web.UI.WebControls.HiddenField.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +10
   System.Web.UI.Page.RaiseChangedEvents() +165
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1485

If I remove the RadAjaxPanel, the page works correctly.  The ReportViewer is not within the RadAjaxPanel and in fact is in a different RadPageView.  Do you have any thoughts on this?
Thanks,
Bob O'Dell
Maria Ilieva
Telerik team
 answered on 08 Dec 2008
5 answers
1.1K+ views
I have read over several times and searched the site for references but cannot seem to figure this one out<g>...

I have a row, with one editable field, qtyordered, I can access the values of the quantity supposedadly from the code below with the radnumeric text box... 

Along with this value, I need additional field values from the row....

according to your docs,  

TableCell cell = dataItem["UniqueName"] is the method to define it , then 
 cell["UniqueName"].text will get the value,

your example though<g> doesn't show a definition for dataItem[] .... and I cannot seem to find a way to get that ..

so, below is the method, I want to access the data in the row for the column unique name..

Thanks for your help....

 protected void radGrid1_QtyChanged(object sender, EventArgs e)
    {
        string UserSysID,
            PartID;
        decimal UnitPrice,
                ExitPrice;

          TableCell cell = dataItem["r1_PartNumber"];
   
            RadNumericTextBox qtyOrdered = (RadNumericTextBox)item.FindControl("qtyorderedRadNumericTextBox");
            string qOrd = qtyOrdered.Text;
            PartID = cell["r1_PartNumber"].text;
    }

Andy

Andy
Top achievements
Rank 1
 answered on 08 Dec 2008
2 answers
134 views
Hi,
I have a radGrid on my form. The grid has a rowclick event which calls the following js function:

function

 

Click() {

 

 

var ajaxManager = $find("RadAjaxPanel2");

 

ajaxManager.ajaxRequest(2);

}

2 problems on this scenarioi. First is that the function is not only called on rowclick, but also on page lod. Is there a workaround for this? Second is that $find("RadAjaxPanel2") gives null at page load. Any suggestions on how to fix?

Maria Ilieva
Telerik team
 answered on 08 Dec 2008
1 answer
375 views
Ok, telerik riddle me this,

I've built a grid where when in insertiing/updating mode I have two cascading drop downs, the first of which I'm adding the selected index change event when the item is being created. I got everything working splendidly, even the Ajax was working on it and it was beautiful. Then I added GridDropDownListColumnEditors to the grid columns so when in edit mode they'd look all pretty but by doing so that stopped the cascading when in inserting/editing mode. Now why in the world would that have an effect on the behavoir of the control because it shouldn't. Isn't that like one of the first rules about programming, style changes should not have any effect on functionality?

My assumtion is that if you use the GridDropDownListColumnEditors, then in my selected index change event i need to have my column editors also rebind along with the drop down columns?? Or do i need to declare in my rad ajax manager that the editor columns can update the other or vice versa? Currently the only thing the rad ajax manager has declared is that the grid can control itself.

The following code is the selected change event that makes the cascading work.

 
    protected void Category_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e) 
    { 
        //First reference the edited grid item through the NamingContainer attribute 
        GridEditableItem editedItem = (sender as RadComboBox).NamingContainer as GridEditableItem; 
 
        //The dropdown list will be the first control in the Controls collection of the corresponding cell 
        RadComboBox ddlist = editedItem["ParentCategory"].Controls[0] as RadComboBox; 
 
        //Change the data source of the sub-categories dropdown list 
        sdsSubCategories.SelectParameters.Clear(); 
        sdsSubCategories.SelectParameters.Add("ParentCategoryId", ddlist.SelectedValue); 
        sdsSubCategories.DataBind(); 
 
        //Change the combox's datasource to the sub categories datasource 
        RadComboBox ddlistSub = editedItem["SubCategory"].Controls[0] as RadComboBox; 
        ddlistSub.DataSource = Schools.SubCategoryList(Convert.ToInt32(ddlist.SelectedValue)); 
        ddlistSub.DataBind(); 
    } 

Sebastian
Telerik team
 answered on 08 Dec 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?