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 after I click on a lower level node in the
treeview?
Thanks,
Billy
<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="BudgetCreate.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<br />
<br />
<br />
<br />
<br />
<br />
<hr style="z-index: 102; left: 0px; position: absolute; top:
0px" />
<hr style="z-index: 103; left: 0px; position: absolute; top:
0px" />
<hr style="z-index: 104; left: 0px; position: absolute; top:
0px" />
<asp:Panel ID="Panel1" runat="server" Height="104px"
ScrollBars="Vertical" Style="z-index: 105;
left: 0px; position: absolute; top: 0px" Width="200px">
<asp:TreeView ID="TreeView1" runat="server" Style="z-index:
100; left: 0px; position: absolute;
top: 0px">
<Nodes>
<asp:TreeNode Text="New Node" Value="New
Node"></asp:TreeNode>
<asp:TreeNode Text="Expenses" Value="Expenses">
<asp:TreeNode Text="Auto" Value="Auto">
<asp:TreeNode Text="Fuel"
Value="Fuel"></asp:TreeNode>
<asp:TreeNode Text="Insurance"
Value="Insurance"></asp:TreeNode>
<asp:TreeNode Text="Maintenance"
Value="Maintenance"></asp:TreeNode>
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Clothing"
Value="Clothing"></asp:TreeNode>
<asp:TreeNode Text="Donations" Value="Donations">
<asp:TreeNode Text="Church"
Value="Church"></asp:TreeNode>
<asp:TreeNode Text="Red Cross" Value="Red
Cross"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Medical" Value="Medical">
<asp:TreeNode Text="Dentist"
Value="Dentist"></asp:TreeNode>
<asp:TreeNode Text="Alergist"
Value="Alergist"></asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
</asp:Panel>
</form>
</body>
</html>