473,396 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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=document.getElementById("divAdmFeedTree") ;

if(scrollel!=null)
{

var
scrollval=document.getElementById("ctl00_CPHBase_d ivAdmFeedTreeScroll");
//alert("S");
if(scrollval!=null && scrollval.value!=null)
{
alert(scrollval.value);
scrollel.scrollTop=scrollval.value;
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_SelectedNode";
var Node = document.getElementById(name);

if(Node!=null){

/var selectedNode=null;

if(Node.value!=null && Node.value.length>0)
{
selectedNode = document.getElementById(Node.value);
}
if(selectedNode!=null)
selectedNode.scrollIntoView(true);
selectedNode.focus();
}

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

Thanks,

Oct 13 '06 #1
0 1284

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

Similar topics

0
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...
0
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...
0
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...
0
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
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....
0
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...
3
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
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...
17
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.