CodeVerge.Net Beta


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

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > microsoft_downloads.css_friendly_control_adapters Tags:
Item Type: NewsGroup Date Entered: 5/22/2006 1:24:51 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 5 Views: 65 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
6 Items, 1 Pages 1 |< << Go >> >|
pyrobri
Asp.Net User
Showing current node in tree view5/22/2006 1:24:51 PM

0/0

Hi,

I have a tree view displaying a selection of pages in my site based on a sitemap. By default the view is collapsed. When a user clicks a link within it obviously it navigates to that page. However the treeview then defaults back to being closed. Does anyone know how to navigate to a new page and open the treeview back at that node? Also showing that as the current selected node would be very handy?

Cheers..


==========================
www.netneighbourhood.co.uk
pyrobri
Asp.Net User
Re: Showing current node in tree view6/5/2006 11:48:48 AM

0/0

Hi, Still having trouble with this one, anyone out there got any pointers?

Cheers


==========================
www.netneighbourhood.co.uk
Russ Helfand
Asp.Net User
Re: Showing current node in tree view6/6/2006 5:10:29 PM

0/0

I hear ya! Others have commented on the lack of these features, too, and they are definitinely "on the radar" for the next rev of this adapter sample kit.  Meanwhile, I've tried to share some of the unofficial code being considered.  You might find this earlier posting interesting:

http://forums.asp.net/thread/1294834.aspx

The following enhancement to the GetNodeClass method in the TreeViewAdapter class is being considered:

        private string GetNodeClass(TreeNode item)
        {
            string value = "AspNet-TreeView-Leaf";
            if (item != null)
            {
                if (item.Depth == 0)
                {
                    if (item.ChildNodes.Count > 0)
                    {
                        value = "AspNet-TreeView-Root";
                    }
                    else
                    {
                        value = "AspNet-TreeView-Root AspNet-TreeView-Leaf";
                    }
                }
                else if (item.ChildNodes.Count > 0)
                {
                    value = "AspNet-TreeView-Parent";
                }

                if (item.Selected)
                {
                    value += " AspNet-TreeView-Selected";
                }
                else if (IsChildNodeSelected(item))
                {
                    value += " AspNet-TreeView-ChildSelected";
                }
                else if (IsParentNodeSelected(item))
                {
                    value += " AspNet-TreeView-ParentSelected";
                }
            }
            return value;
        }

        private bool IsChildNodeSelected(TreeNode item)
        {
            bool bRet = false;

            if ((item != null) && (item.ChildNodes != null))
            {
                bRet = IsChildNodeSelected(item.ChildNodes);
            }

            return bRet;
        }

        private bool IsChildNodeSelected(TreeNodeCollection nodes)
        {
            bool bRet = false;

            if (nodes != null)
            {
                foreach (TreeNode node in nodes)
                {
                    if (node.Selected)
                    {
                        bRet = true;
                        break;
                    }
                    bRet = IsChildNodeSelected(node.ChildNodes);
                }
            }

            return bRet;
        }

        private bool IsParentNodeSelected(TreeNode item)
        {
            bool bRet = false;

            if ((item != null) && (item.Parent != null))
            {
                if (item.Parent.Selected)
                {
                    bRet = true;
                }
                else
                {
                    bRet = IsParentNodeSelected(item.Parent);
                }
            }

            return bRet;
        }

These enhancements follow the pattern of distinguishing the rendered markup by decorating it with additional CSS classes like AspNet-TreeView-Selected, AspNet-TreeView-ChildSelected or AspNet-TreeView-ParentSelected.

If you define these classes in your CSS files you can control the coloration, font, etc. of the selected node and parents/children above/below it on the tree.

Finally, you asked about having the tree restored to its previous state of expansion.  None of the aforementioned enhancements address that... but it definitely on the radar. Your continued patience is appreciated.


Russ Helfand
Groovybits.com
Russ Helfand
Asp.Net User
Re: Showing current node in tree view10/26/2006 4:04:24 PM

0/0

Beta 3 of the kit, posted to http://www.asp.net/cssadapters earlier this week, supports automatic reexpansion of the adapted TreeView.
Russ Helfand
Groovybits.com
pyrobri
Asp.Net User
Re: Showing current node in tree view11/29/2006 2:39:07 PM

0/0

Hi Russ,

Thanks for the update on this one.
Has been quite a while noe since i have had time to update my site much. I have just uploaded the new adapters, assume i could just copy over the old ones?
Anyway I can't exactly remember now how I set it all up. Any chance of a pointer to what i need to change to get this to work?

Regards

Brian


==========================
www.netneighbourhood.co.uk
Russ Helfand
Asp.Net User
Re: Showing current node in tree view11/29/2006 2:45:25 PM

0/0

Yes, generally, you will just copy over (on top of) the older adapters.  Follow the instructions here and you should be OK, http://www.asp.net/cssadapters/whitepaper.aspx#SamplesUsingInYourWebSite.


Russ Helfand
Groovybits.com
6 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
C# for Programmers: Updated for C# 2.0 Authors: Paul J. Deitel, Pages: 1317, Published: 2005
Visual C# 2005: How to Program Authors: Harvey M. Deitel, Paul J. Deitel, Pages: 1591, Published: 2006
Pro Visual C++/CLI and the .NET 2.0 Platform Authors: Stephen R. G. Fraser, Pages: 917, Published: 2005
Learning C# 2005: Get Started with C# 2.0 and .NET Programming Authors: Jesse Liberty, Brian MacDonald, Pages: 528, Published: 2006
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Pro .NET 2.0 Windows Forms and Custom Controls in C#: From Professional to Expert Authors: Matthew MacDonald, Pages: 1037, Published: 2005
Beginning ASP.NET 3.5 in VB 9.0: From Novice to Professional Authors: Matthew MacDonald, Pages: 1149, Published: 2007
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Programming Visual Basic 2005 Authors: Jesse Liberty, Pages: 548, Published: 2005
Programming .NET Windows Applications Authors: Jesse Liberty, Dan Hurwitz, Pages: 1228, Published: 2003

Web:
Showing current node in tree view - ASP.NET Forums Does anyone know how to navigate to a new page and open the treeview back at that node? Also showing that as the current selected node would be very handy? ...
Access the TreeView Control's Current Node Properties The TreeView control reports its current node--the selected node--only in its NodeClick event's Node parameter. If you need to access the Node's ...
TreeView node... - .NET C# trapped the click event of the treeview but that is not node specific. In the code I have a variable to remember the current node. ...
Menu View Toolbar; Navi Toolbar; Scrollbar; Show Current Node Path; Show Memory Monitor; Text Area; XPath Debugger; Graphical Tree View ...
How to: Iterate Through All Nodes of a Windows Forms TreeView Control The child nodes of the current node, if there are any, are listed in its Nodes property. The TreeView control itself has the TopNode property, ...
Nabble - ydn-javascript - Refresh of Treeview with current node ... Refresh of Treeview with current node expanded and new data populating node. ... Reply to Author | View Threaded | Show Only this Message ...
TreeView Control in VB .NET Parent: Gets the parent node of the current node PrevNode: Gets the previous sibling node PrevVisibleNode: Gets the previous visible node TreeView: Gets the ...
CodeProject: A TreeView Control with ComboBox Dropdown Nodes. Free ... But it's a start, and has worked in my current project. ..... Can you help me to show a TreeView having Node as a Text(may not be editable), but also with a ...
Interactive Exploration of Decision Tree Results with the current node e.g. the number of errors and datapoints. With these .... a very good detail of an interesting sub-tree in the explorer-like view with ...
Site Navigation in ASP.Net 2.0 Menu, TreeView, Crumbs There are 4 types of nodes in a treeview. Root Node. Each siteMapPath has one root node. Selected Node. The current node matches the page the user is on ...

Videos:
A Googly MySQL Cluster Talk Google TechTalks April 28, 2006 Stewart Smith Stewart Smith works for MySQL AB as a software engineer working on MySQL Cluster. He is an active memb...
Web Applications and the Ubiquitous Web Google TechTalks February 1, 2006 Dave Raggett Dave Raggett is currently a W3C Fellow from Canon, and W3C Activity Lead for Multimodal Interaction....




Search This Site:










without visual studio.net

same result from multiple browsers

how to use codebehide model in global.asax in .net 20, i try it but failed.

combining aspx and aspx.vb

two types of variable

urgent please help in this questionnare...

regarding asp.net integration with moss

how do we debug using webmatrix in asp.net?

asp.net basic sample hello world does not appear on browser

how can i convert/truncate a uint64 value to a int32 ?

totitlecase not working

restrict access from a specific ip address?

pdf creation

portal creation

space for narrative in an aspx page ( how too)

send new users id with automatic email

how to check file's extension file?

get http status code (c#)

concatinating the 2 strings using substring in c#.net 2003

how to let website members create thier own folders

how to control the quality of an asix image

testing asp app

iis

customerror doesn't work on production

<embed> element

how do i create a disclaimer pop-up window?

textbox text color.

adding an event handler from a base class

how to create webpages dynamically in asp.net?

urgent help needed!!

  Privacy | Contact Us
All Times Are GMT