CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 4/14/2006 2:47:39 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 64 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
sabu21s
Asp.Net User
Remove childNode from a Treeview Control4/14/2006 2:47:39 PM

-1/1

Hi I have a treeview and am trying to delete a childnode under the GVListPos_RowDataBound method. Can some please suggest as to how we can accomplish this task..
MY TREEVIEW:

<asp:TreeView ID="tvAction" runat="server" ImageSet=arrows  NodeIndent="10">
                                        <Nodes>
                                            <asp:TreeNode Text="Please Select An action" Value="mAction" Expanded="False"  SelectAction=expand ToolTip="Click here to see View/Edit/List/EDI links">
                                                <asp:TreeNode Text="View" Value="View"></asp:TreeNode>
                                                <asp:TreeNode Text="Edit" Value="Edit"></asp:TreeNode>
                                                <asp:TreeNode Text="List" Value="Copy"></asp:TreeNode>
                                                <asp:TreeNode Text="Image" Value="Image"></asp:TreeNode>
                                                <asp:TreeNode Text="EDI" Value="EDI"></asp:TreeNode>
                                            </asp:TreeNode>
                                        </Nodes>
             <ParentNodeStyle Font-Bold="True" ForeColor="#5555DD" />
             <HoverNodeStyle Font-Underline="False" />
             <SelectedNodeStyle Font-Underline="True" HorizontalPadding="0px" VerticalPadding="0px" />
             <NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="5px"
                 NodeSpacing="0px" VerticalPadding="0px" />
                                    </asp:TreeView>
protected void GVListPos_RowDataBound(object sender, GridViewRowEventArgs e)
    {
string sImagePath = ((HiddenField)e.Row.Cells[0].FindControl("hiddenImagePath")).Value;
if (sImagePath == "")
                {
                    tv.Nodes[0].ChildNodes.Remove(???? What do I put in here?);
                }
}

I am trying to remove the Image childnode...
Thanks

dannychen
Asp.Net User
Re: Remove childNode from a Treeview Control4/14/2006 4:25:11 PM

-2/2

You would pass in a TreeNode object.  The one you wanted to remove.  Sometimes I find this code pattern is easier to use (it only works for sub nodes, not root nodes):

TreeNode nodeToBeRemoved = getSomeNodeToBeRemoved();
nodeToBeRemoved.ParentNode.ChildNodes.Remove(nodeToBeRemoved);

--
Danny


disclaimer: Information provided is 'as is' and conveys no warranties or guarantees.
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
C# for Programmers: Updated for C# 2.0 Authors: Paul J. Deitel, Pages: 1317, Published: 2005
Sams Teach Yourself Visual Basic 2005 in 24 Hours: Complete Starter Kit Authors: James D. Foxall, Pages: 536, Published: 2006
Visual C# 2005: How to Program Authors: Harvey M. Deitel, Paul J. Deitel, Pages: 1591, Published: 2006
Visual Basic 2005: How to Program Authors: Harvey M. Deitel, Pages: 1513, Published: 2006
Pro .NET 2.0 Windows Forms and Custom Controls in C#: From Professional to Expert Authors: Matthew MacDonald, Pages: 1037, Published: 2005
Application Development Using Visual Basic and .NET Authors: Robert J. Oberg, Peter Thorsteinson, Dana L. Wyatt, Pages: 830, Published: 2002
Sams Teach Yourself Visual Basic.Net in 24 Hours Authors: James D. Foxall, Pages: 508, Published: 2001
Visual Basic 2005 with .NET 3.0 Programmer's Reference: Programmer's Reference Authors: Rod Stephens, Pages: 1200, Published: 2007
Programming Visual Basic .NET Authors: Jesse Liberty, Dave Grundgeiger, Pages: 541, Published: 2003
Mastering Visual Basic.NET Authors: Evangelos Petroutsos, Pages: 1153, Published: 2002

Web:
How to: Add and Remove Nodes with the Windows Forms TreeView Control TreeView control stores the top-level nodes in its P:System.Windows.Forms. TreeView. ... Adds new node as a child node of the currently selected node. ...
Remove childNode from a Treeview Control - ASP.NET Forums Remove childNode from a Treeview Control. Last post 04-14-2006 12:25 PM by dannychen. 1 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
Delete child node from Treeview : treeview, child, delete Nodes(myIndex).Child While anyNode.Children <> 0 myTree.Nodes.Remove... ... 4, Check All Nodes of TreeView control · MS Visual Basic. 5, Remove All Child ...
Adding Child node to a Child node in a TreeView control ... To make this topic appear first, remove this option from another topic. ... I am trying to work on the TreeView Control. I have added ...
Remove Root Node in treeview Control - ASP.NET Forums I used treeview Control, problem is doesn't Remove in RootNode ... -Child Node. Disable root node. only visable Parent node and Child node ...
How to: Add and Remove Nodes with the Windows Forms TreeView Control Because the Windows Forms TreeView control displays nodes in a hierarchical manner, ... Adds new node as a child node of the currently selected node. ...
CodeProject: The Basic Operations on using the TreeView Control ... Sep 30, 2005 ... The Basic Operations on using the TreeView Control. By Yıltan Bitirim .... It creates a child node under the selected parent node. ...
Telerik Treeview Control - Eric Wise Here is the html attributes of the treeview control for reference. .... AddNode( childNode) 28 Next childRow 29 End Sub 30 31 Private Function ...
[TreeView] Child Nodes - Visual Basic 4 / 5 / 6 Does anyone have a custom function to Remove a child node from a TreeView and move it .... NET); populte treeView control with xml file (C#) ...
Introduction to Tree View Control The article below explores the Tree View Control and depicts the way as how to add a Child node or a sibling node to the selected node. ...




Search This Site:










how to place javascript datepicker in asp:content tag

getting rid of the space above a master page

menu using sitemap, where to specify imageurl?

changing theme dynamically based on postback state?

work on regular webpage but not on webpage with masterpage

changing content page from page_load of same content page

can't reach control placed in loginview

reference control on master page from the aspx page

how can i align to left a submenu items?

default focus

masterpage head rendering...

nested master pages

setting compiled masterpage (from code)

can i do this with masterpages?

masterpage, javascript, and xhtml : microsoft jscript runtime error: object expected

custome sitemapprovider

change color of 1 menu item

how to populate menus and sitemap(to display the path) dynamically using multiple site map files

using the dynamicmenustyle on the menu control

need help using skmmenu.

how can i add css menus in masterpage table.

sitemap - how to have multiple parent nodes?

unable to view the sitemap ?

master page and external css

default.skin does not seem to be being referenced properly

how can i embed *.swf file in a matster page menu

set master page <body onload=xxxx> from content page

solved!: setting base in head of master page from content page for url rewrite

sitemappath and sitemapresolve

ref c# code to css file

  Privacy | Contact Us
All Times Are GMT