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

Horizontal scroll position getting reset when Ajax call is made from OnClientContextMenuShowing() function

1 Answer 117 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Shahid
Top achievements
Rank 1
Shahid asked on 15 Nov 2010, 12:28 PM
Hi,

We are facing an Issue with the position of horizontal scroll of the rad tree view when we right click on any node of the tree to open its context menu.

Suppose this scenario:- A user moves the horizontal scroll of the tree view towards right, then he right clicks on any tree node to open the context menu. When the context menu is visible, the position of the horizontal scroll is moved to the extreme left and do not remain at the position where the user has last left it.

In the javascript function OnClientContexMenuShowing() we are making an Ajax call using the AjaxManager. Code is present below for your reference. It seems to me that this Ajax request is some how resetting the position of horizontal scroll bar to initial position( extreme left). Do we have any work around for thi Issue.. ?

 

 

 

 

<

 

rad:RadTreeView ID="RadTreeView1" runat="server" Height="96%" OnClientContextMenuShowing="OnClientContextmenuShowing"

 

 

 

 

OnClientNodeClicked="OnTreeNodeClick" OnClientDoubleClick="OnTreeNodeDoubleClick"

 

 

 

 

OnClientContextMenuItemClicked="OnTreeContextMenuClick" OnClientNodeExpanding="toggleHandler"

 

 

 

 

OnClientNodeCollapsing="toggleHandler">

 

 

 

 

</rad:RadTreeView>

 

 

 


 

 

 

 
function OnClientContextmenuShowing(sender, e) { 
  
//Get the ajax manager object
  
clientAjaxRequest("UpdateMenu"); 
   
return false;
}

 

 

 

 

function clientAjaxRequest(arg) {
  
var ajaxManagerObject = $find("<%= RadAjaxManager1.ClientID %>"); 
  
ajaxManagerObject.ajaxRequest(arg);
  

1 Answer, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 18 Nov 2010, 02:15 PM
Hello Shahid,

Well, this information (about the scroll position of the TreeView) is not implicitly persisted. You will have to remember the scroll position of both horizontal and vertical scroll and apply it on ClientLoad event of the TreeView.
Since this is done on AJAX request, you don't need to store this data in cookies (the page is not completely reloaded) - you can simply store the values in some JavaScript variables.


Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
TreeView
Asked by
Shahid
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Share this question
or