CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.internet_explorer_web_controls Tags:
Item Type: NewsGroup Date Entered: 10/10/2003 10:41:35 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 0 Views: 22 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
hibbsa
Asp.Net User
Expanding a specific TreeNode on a TreeView control10/10/2003 10:41:35 PM

0/0

Hi,
I've been trying to programmatically expand a TreeView control to a specific node at runtime. I'm getting into a muddle and was wondering if anyone could tell me if there is actually a simple way to do this. Any help would be much appreciated!!!
Regards,
Al
DotNetShah
Asp.Net User
Re: Expanding a specific TreeNode on a TreeView control10/15/2003 12:48:31 PM

0/0

Hi Al,
Yes, there is a simple way. I hope that the following peace of code will answer your question.
protected TreeView catTree = new TreeView();


private void Page_Load(object sender, System.EventArgs e){

if( !IsPostBack){
TreeNode _oTreeNode = new TreeNode();
_oTreeNode.Text = "Root";
_oTreeNode.NodeData = "0";
_oTreeNode.Expandable = ExpandableValue.Always;

catTree.Nodes.Add( _oTreeNode);
catTree.DataBind();
}
}

protected void OnNodeExpanded( object sender, TreeViewClickEventArgs e){
TreeView _oTree = sender as TreeView;
if( null != _oTree){
string _sFullPath = e.Node;
TreeNode _oTreeNode = _oTree.GetNodeFromIndex( _sFullPath);
if( null != _oTreeNode){
if( null == _oTreeNode.Nodes || _oTreeNode.Nodes.Count == 0){
CCategory[] _oChildCategories = CCategory.GetChildren( int.Parse( _oTreeNode.NodeData));
foreach( CCategory _oChild in _oChildCategories){
TreeNode _oNewTreeNode = new TreeNode();
_oNewTreeNode.Text = _oChild.Name;
_oNewTreeNode.NodeData = _oChild.CategoryID.ToString();
_oNewTreeNode.Expandable = ExpandableValue.Always;
_oTreeNode.Nodes.Add( _oNewTreeNode);
}
}
}
}

}
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Professional ASP.NET 3.5: In C# and VB Authors: Bill Evjen, Scott Hanselman, Devin Rader, Pages: 1673, Published: 2008
Pro ASP.NET 2.0 in VB 2005: From Professional to Expert Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006
ASP.NET 2.0: A Developer's Notebook Authors: Wei Meng Lee, Pages: 326, Published: 2005
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
Visual Basic 2005: How to Program Authors: Harvey M. Deitel, Pages: 1513, Published: 2006
Programming Visual Basic 2005 Authors: Jesse Liberty, Pages: 548, Published: 2005
Visual C# 2005: How to Program Authors: Harvey M. Deitel, Paul J. Deitel, Pages: 1591, Published: 2006
Programming ASP.NET: Building Web Applications and Services with ASP.NET 2.0 Authors: Jesse Liberty, Dan Hurwitz, Pages: 930, Published: 2005
C# for Programmers: Updated for C# 2.0 Authors: Paul J. Deitel, Pages: 1317, Published: 2005
Core Internet Application Development with ASP.NET 2.0 Authors: Randy Connolly, Pages: 1049, Published: 2007

Web:
Simulate clicking on a tree node in treeview control : click ... How do I simulate clicking on a treenode in a treeview control in code? ... find the specific tree node in the treeview using javascript and do a Control. ...
treenodes not expanding when selectednodechanged event defined ... Hi - I'm using a treeview control in a sharepoint webpart. ... am not passing in a node specific id value. the call should be this: usr = new TreeNode(user. ...
InformIT: Designing GUI Applications with Windows Forms > Using ... You can override the image on a specific node by setting the TreeNode. ... Adding a TreeNode to the TreeView control can be done at both runtime and design ...
Using the TreeView IE Web Control In the left frame, you could have a TreeView control. When the user clicks a TreeNode, detailed information about that particular node could then appear in ...
navigation treeview control - expanding and collapsing - ASP.NET ... navigation treeview control - expanding and collapsing. Rate It (1) ... private void PrintRecursive() { foreach (TreeNode tn in TreeView1. ...
TreeNode location - .NET C# If I use TreeView.Nodes.IndexOf(new TreeNode(textvalueofname)) it always .... If you are re-expanding a tree to a specific node after ...
.NET TreeView FAQ - Drag and Drop Right Click Menu NET TreeView control? This article contains code samples for the most common questions I've .... to a specific object. TreeNode drop = (TreeNode)e.Data. ...
TreeView Control - Background Image? - ProgrammingTalk Is there a way to set the background image of a TreeView control like you used ..... Private Sub DrawThisNode(ByVal g As Graphics, ByVal node As TreeNode, ...
navigation treeview control - expanding and collapsing - ASP.NET ... navigation treeview control - expanding and collapsing ... e) { PrintRecursive() ; } private void PrintRecursive() { foreach (TreeNode tn in TreeView1. ...
ModelElementTreeNode Members (Microsoft.VisualStudio.Modeling.Shell) EnsureVisible, Ensures that the tree node is visible, expanding tree nodes and scrolling the tree view control as necessary. (Inherited from TreeNode.) ...




Search This Site:










asp 2.0 impersonate user in code

gridview data based on user login

controling multiple login

v2.0.4 registration broken - help?

admin menu has gone public??? - help!

profilecommon settingspropertynotfoundexception while it's right there in the web.config

master page disappeared from installed templates

referencing session variables

please help me understand alias concept

combining the two data bases

security using sessions?

updating roles list with azman role provider

sizing controls

theme for a user control

working classifieds site - problem with firefox

ftb not loading in parent portals

treeview error

any private messaging modules for dnn 2.1.2?

account login generates error only with admin and host logins

converting asp to asp.net 2.0

free dnn3 skins?

creating second parent portal on iis 6 win 2003

how to force a page to be opened only after clicked on a button on another page?

converted asp.net 2.0 web app starts in asp.net 2.0, not 3.x

has dnn b2 been released yet?

how to: send email using system.net.mail

exception hanndling message in component ?

link module keeps apperaing on new pages

masterpage path for <scripts..>

the 'system.web.security.sqlmembershipprovider' requires a database schema compatible with schema version '1'.

 
All Times Are GMT