Custom TreeView without behavior
On a project I have worked on, we needed to display a tree view in an ASPX page. The client needed the ability to print the page through IE print command. We started to use the TreeView control coming with the IE Web Controls released by the ASP.NET team. Then we realized that the tree view was not printing correctly due to the use of a client behavior coming with the TreeView server control. The client behavior is automatically activated on IE 5.5+, and deactivated for previous or non IE browsers. ...But, the client behavior cannot be deactivated on up-level browsers!
I was not panicked as luckily MS had released the source code of the IE Web Controls not long before. After some investigation in the existing code, I found a way to create a custom TreeView control that would allow the client behavior to be deactivated. My TreeView is just an extension of the base TreeView with an added BehaviorUsage property which values can be Default, Deactivated or Forced. The source code is available for your curiosity or use.
This case is just an other example of the advantages of releasing source code...