The Eric Wroolie Blog

Overpass Experiences

  • Blog
  • Videos
  • Overpass Apps

Powered by Overpass Apps

Hanselman’s Ultimate Toolkit Post

August 27, 2007 by wroolie Leave a Comment

For the past few years, Scott Hanselman has been posting his list of Ultimate Developer tools on his blog. If you are into .Net development, it is definitely worth a look. Check out http://www.hanselman.com/tools.

Some of the tools he mentions are tools that I’ve started using over the past year. Others are tools I plan on using very soon. My favourite tools to date are Fiddler, Web Developer for Firefox, and WatIn Test Recorder. Most of the items on the list are freeware or open source and none are available as part of the standard Microsoft Suite of controls.

Filed Under: C# Coding, Software Dev & Productivity

Maintaining Treeview State in Asp.Net 2 with a Sitemap

June 29, 2007 by wroolie 2 Comments

For a couple of days, I was looking around for a way to expand a treeview menu to the node you are currently on. On a site with nodes that go several levels deep, it is a pain to have to open all the nodes every time a postback occurs.

I found code samples online and followed so many goosechases. Some people put a marker in the session to let them know where their node was. Others tried to do some clever javascript which didn’t seem to work for me. It seems to be some code that is heavily in demand.

Finally, I found a blog post by Walt Ritscher which helped me get what I wanted in a few lines of code. It doesn’t maintain the state of all open and closed nodes on the tree, but it does open the tree to the node with the URL of the page you are on. It took me so long to find his blog post from last year, that I thought I would add another link here:

http://waltritscher.com/blog/ramblings/archive/2006/05/18/843.aspx

His examples are in VB.Net, but a conversion to c# is not difficult. Here are my code examples:

In the .aspx page:

<asp:TreeView ID=”TreeView1″ ExpandDepth=”0″ OnTreeNodeDataBound=”treeMainMenu_TreeNodeDataBound” PopulateNodesFromClient=”false” NodeWrap=”false” HoverNodeStyle-ForeColor=”green” HoverNodeStyle-Font-Underline=”true” NodeIndent=”10″ Height=”100%” runat=”server” DataSourceID=”SiteMapDataSource1″>

</asp:TreeView>

Notice the “OnTreeNodeDataBound” and “PopulateNodesFromClient” attributes.

In the code behind:

protected void treeMainMenu_TreeNodeDataBound (

Object sender,

System.Web.UI.WebControls.TreeNodeEventArgs e )

{

if (Request.Url.PathAndQuery == e.Node.NavigateUrl) {

e.Node.ExpandAll();

}

if (e.Node.NavigateUrl == “”) {

e.Node.SelectAction = TreeNodeSelectAction.Expand;

}

}

Anyway, thanks to Walt for his blog post. I looked over some other posts in his blog and found it very interested. You might want to have a look too.

Filed Under: C# Coding, Software Dev & Productivity

Microsoft Learning has Free WPF course

October 14, 2006 by wroolie Leave a Comment

Microsoft learning has their WPF online course available for free. It will probably cost money at some time in the future after Vista is released.

The course is 6 hours long and pretty comprehensive. You might want to check it out:

https://www.microsoftelearning.com/eLearning/offerDetail.aspx?offerPriceId=109340

Filed Under: C# Coding, Software Dev & Productivity

  • « Previous Page
  • 1
  • …
  • 4
  • 5
  • 6
  • 7
  • Next Page »

Recent Posts

  • My Gig and the Imposter Syndrome
  • Getting Picked Last for Teams in PE
  • One Little Growth Opportunity at a Time
  • I’m sorry if I look like I know what I’m doing
  • New Years Reclamations