473,670 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Return a scrolling Treeview to same spot after pageback

I have been beating my head against a wall trying to get my treeview to
return to the same scrolled to location after a postback. I have used
the following javascript to set the scroll for a div section with no
luck. The js runs, returns a valid current scroll value, but the
scrollTop stays at 0.

var scrollel=docume nt.getElementBy Id("divAdmFeedT ree");

if(scrollel!=nu ll)
{

var
scrollval=docum ent.getElementB yId("ctl00_CPHB ase_divAdmFeedT reeScroll");
//alert("S");
if(scrollval!=n ull && scrollval.value !=null)
{
alert(scrollval .value);
scrollel.scroll Top=scrollval.v alue;
alert(scrollel. scrollTop);

}
}

I have also used the following js code (and several different versions
of it) to set the ScrollintoView, also with no luck.

var name = "ctl00_CPHBase_ tvCategories_Se lectedNode";
var Node = document.getEle mentById(name);

if(Node!=null){

/var selectedNode=nu ll;

if(Node.value!= null && Node.value.leng th>0)
{
selectedNode = document.getEle mentById(Node.v alue);
}
if(selectedNode !=null)
selectedNode.sc rollIntoView(tr ue);
selectedNode.fo cus();
}

A fresh set of eyes (or perspective) would be greatly appreciated.

Thanks,

Oct 13 '06 #1
0 1293

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1284
by: hzgt9b | last post by:
Using VS 2003, VB.NET: Have a TreeView filled with TreeNodes. Initially when my app starts up the TreeView is getting a horizontial slider. The problem is that the slide is full right... I want it to be full left. The only way I see how to control the scrolling on the TreeView is the "EnsureVisible" property and in this case its not helping. Any ideas on how to programatically set the horizontal scroll to be full left? Thanks in advance...
0
1472
by: Dave harris | last post by:
Is anyone aware of any issues with Drag and Drop in a treeview having trouble scrolling past the top/bottom? For this particular control, scrolling down works about 50% of the time and is pretty sensitve (the mouse has to be just so). Scrolling up doesn't work at all. I have tried docking it on a panel and giving the panel a nice thick dock padding to help separate it from other controls on the dialog and it doesn't seem to help.
0
1105
by: Steve | last post by:
The treeview has this habit of scrolling when you change the tree's selection so that the selected item is visible. 9 times out of 10 this is the behavior that you'd want, but what do I do to prevent the tree view from scrolling when making a selection? Is there a flag I can pass in with the selection change message? Is there a notification that I can grab and block? Thanks
0
914
by: Tom | last post by:
I am implementing drag and drop in a treeview. How do I get the treeview to automatically scroll when the mouse carrying the node I am dragging reaches the top or bottom of the treeview?
6
4922
by: L.M | last post by:
Hello, I knew how to use the treeview under VB6. After migrating to .NET, well, I'm lost. I try to add a new node, either to the same level or as a child to a selected node in the treeview. However, either it only add it to the root level or it only add it on level below, doesn't matter what I select. And in some case, I just get an exception.
0
1751
by: billy_cormic | last post by:
Hello, I am currently using Visual Studio 2005 for a project and I am attempting to employing the new treeview control using VB.net. I have placed the treeview on top of a panel and have enabled vertical scrolling on the panel. The problem is that when I scroll down towards the bottom of the treeview and click on one of the nodes the scroll bar jumps back to the top. Is there anyway to keep the vertical scroll bar in the same position...
3
1224
by: Progman | last post by:
Hi folks, This ASP.NET is awesome! I was a rookie and now I am becoming much better. txs for Scott Gu videos. Scott you rock man! ======
1
2256
by: Woof | last post by:
Hi, I'm populating the nodes of a Tree View control via an SQL database, with the lowest child nodes (leaves from now on) Text field being set to a lengthy set of HTML. The outcome is a beautifully formated list of data, where the leaves each show several rows from the SQL database. THE PROBLEM: When I expand each node level manually (clicking the +), the table format of the leaves is spot on, with each column of data formated...
17
4708
by: pigeonrandle | last post by:
Hi, I have seen loads of different ways to do this, but the all seem to yield the same result - text that doesn't flicker when it's moving too slowly! Does anyone know 'the best way' to make text scroll... eg Override OnPain and OnPaintBackground Override WndProc
0
8901
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8814
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7415
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6213
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4209
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4390
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2799
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2041
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1792
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.