.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to style a TreeView like the Windows Explorer directory tree?

Posted By:      Posted Date: September 09, 2010    Points: 0   Category :WPF
Hi,   how can I set a Style to a TreeView that displays the selected items with a nice shaded background and highlight it when the mouse is over a item? I tried something like this, but it didn't word (the background of the selected items is still Blue, but not Orange): <TreeView x:Name="TreeView" > <TreeView.ItemContainerStyle> <Style TargetType="{x:Type TreeViewItem}"> <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" /> <Setter Property="Visibility" Value="{Binding IsVisible, Mode=TwoWay}" /> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="Background" Value="Orange" /> </Trigger> </Style.Triggers> </Style> </TreeView.ItemContainerStyle> </TreeView>

View Complete Post

More Related Resource Links

I cannot see directory structure from windows explorer


When I do start > run \\servername I used to be able to see all subsites and libraries.

Now I get a blank windows explorer window.  My sysadmin claims he didn't do anything.

Any ideas?

Building a Searchable Phone Directory with Windows SharePoint Services

I want to continue to build out the intranet site we've started in our previous articles. A standard item in every intranet is a staff/employee list. Most companies implementing Windows SharePoint Services (WSS) are large enough to have a database that contains all employees. We will use the aggregation features of SharePoint to include data from this database into our intranet.

Windows Shell: Create Namespace Extensions for Windows Explorer with the .NET Framework


Extending the Windows shell with namespace extensions allows you to create some custom functionality for Windows Explorer. One common use is to enable Explorer to present a list of items that do not exist in one real folder, but actually reside in a number of places. The view on the folder makes it look like these items are in one place, so managing them becomes easier. This article illustrates the process of creating custom shell namespace extensions using C# and the .NET Framework. The author dispels some myths about the difficulty of writing such extensions, and shows that it is easier than it was before .NET. Along the way he outlines undocumented interfaces and describes advanced techniques for consuming them in .NET.

Dave Rensin

MSDN Magazine January 2004

More Windows 2000 UI Goodies: Extending Explorer Views by Customizing Hypertext Template Files


The Web-style interface is the default Explorer folder view for the Desktop Update in Windows 2000. The Desktop Update uses HTML-based hypertext templates to create the Web view, and you can customize these templates to include your own views and commands. This article shows you how the Explorer Web view works and how to build your own custom templates for it. You'll see how to add a command prompt and task buttons to a new folder view using HTML, script, and ActiveX controls. The shell object model and thumbnail shell extensions are also examined, then used to build a simple icon viewer for Explorer.

Dino Esposito

MSDN Magazine June 2000

Issue with opening SharePoint library in Windows Explorer view

I am having trouble opening a document library in Windows Explorer view. The portal is MOSS 2007. I have installed Office 2007 and IE7 on my computer. The error that I get is
"Documents in this folder are not available. The folder may have been moved or deleted, or network problems may be preventing a connection to the server."

Open With Windows Explorer very slow


I am trying to troubleshoot an issue where some users of our SharePoint environment have problems using the open with windows explorer option in a document library.


For some users this works fine...  the explorer opens quickly and they can manage the documents.


For other users it takes up to 5 minutes before the explorer view opens.  During this time the browser becomes completly unresponsive.


As part of the troubleshooting process I tried taking the UNC path that is shown in the explorer view and tried using the Start -> Run and then entering in the path.   This seems to cause the complete desktop to freeze until the explorer window displays.


This is occuring on Windows XP SP Pro SP2 with both IE6 and IE7.   The desktops are on the same domain as the SharePoint servers.


Any thoughts on next steps?

Accessing SharePoint Workspace through Windows Explorer and Office applications

In windows explorer, there is a folder named workspaces. But it is blank and doesnt show any workspaces. I am using office 2010 pro in Win 7 64 bit. As per this article http://blogs.msdn.com/b/sharepoint_workspace_development_team/archive/2010/06/08/surfacing-sharepoint-workspace-data-through-windows-explorer-and-office-applications.aspx, it should be possible.Amila Hendahewa | www.docudude.com/ | @docudude |

LDAP - directory entry issue with out user and password using impersonate and windows authentication

Hi All I am using the below code to fetch the user information from LDAP             DirectoryEntry entry = new DirectoryEntry("LDAP://DEV");             DirectorySearcher searcher =  new DirectorySearcher(entry);             SearchResult result;             searcher.Filter = "samaccountname=testuser";             result = searcher.FindOne(); here i am using windows authentication always and along with that when i enable the impersonate = true ,  the code fails at "result = searcher.FindOne();" with message "object reference not set to instance of an object "  also with the same code if i give the username and password along with the impersonate tag >> it works  or if i am using the user and password along with the DirectoryEntry  object then also it will work  but it fails with same user that i gave in impersonate tag / directory entry object with windows authentication enabled  and the  user logged to the application and no username and password tag in directory entry / impersonate tag  Interesting thing is that  in our development server ,  i am able to execute the same code with out user name p

Windows explorer view doesn't work on Windows 7

We are running Office SharePoint 2007 with SP2 on windows 2003 server. All windows 7 with IE 8 gets this message: " Please wait while Explorer View is loaded. If Explorer View does not appear, your browser may not support it". when click Windows Explorer in View. All Vista and XP work fine. I have tried these: 1. Added the SharePoint site on a Trusted Site. 2. Web Client is set to Automatically start, and that it is started. 3. We have Office 2003 installed on all computers. 4. We also tried to enable Comtability View. Is there a fix?Bob Lin, MS-MVP Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net How to Setup Windows, Network, VPN & Remote Access on http://www.howtonetworking.com

Passing Credentials to IIS "Integrated Windows authentication" Protected Directory

Hello All,I have set up a directory on my IIS web server that is protected by "Integrated Windows authentication".  I want visitors to be required to enter a name and password to view files in the protected directory except if they are following a link to files in the protected directory from a certain page on my website.I am doing this to try to get better protection from search engine spidering than is provided by using a robots.text file. I am using ASP.NET 3.5 with VB.  I am wondering if there is a way to pass the log on credentials to the IIS server via a link, or if there is a way to fill in the name and password for the login screen automatically, or something else that would work.  It is OK if the login name and password are visible to the visitors.Any suggestions on how to do this would be appreciated or if there is a better way to accomplish what I am trying to do, I would like to know.Thanks 

Style depending on Windows Theme

Hi,   I want to style a ToolBar differently depending on which theme is used (Aero or Classic) in Windows 7. I have found some examples on the net but all describe how to do this on custom controls. I want to do this on a normal control. Is that possible?

FAQ: How do I listen to changes in a file/directory in the windows file system?

How do I listen to changes in a file/directory in the windows file system?Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

SharePoint 2007 - Windows 7 - Explorer View (Leaves a copy in recycle bin)

Hi All, I am facing a strange problem with SharePoint 2007 & Windows 7. I open an existing word document from my PC(Windows 7) and click "save as" and provide a SharePoint document library file path (\\machinename\sitename\DocumentLibraryName) and save the file. The word file becomes visible in the Shared document library, BUT it leaves a copy in the recycle bin of the SharePoint site. Works Normal from Windows XP PC. Any clues. Would greatly appreciate anybody's effort. Regards KCM

SharePoint upload files from windows explorer and emails from outlook by drag and drop

Guys, I need to have this functionality to upload files and mails by drag and drop, now sharepoint allows it by having that folderview in IFrame which takes the dropped item, but this does not allow files with spcial characters due to http URL related issue. How can I customize or program this to allow files with special chars in name, if not possible then how can I rename before the drop is over ? thanks, ram    

TreeView node visually unselected after selecting tree node and then clicking soem other field



I am using .NET 3.5 (VS 2008).  I have a SplitContainer with a TreeView on one side and a form with various fields, tabs, etc on the other.  When I select one of the tree nodes, the node is highlighted.  The node loses its highlighting when the user clicks on one of the tabs or enters a field on the other side of the SplitContainer.  Although no highlighting is visible, the treeView.SelectNode() still returns the proper node, so it appears that the tree node is still selected, just not visually highlighted.  The problem is that without the highlighting to distinguish which node is selected, the user can easily get lost.  Is there a build-in mechanism to maintain some sort of highlighting on the selected node when the cursor is moved to another form.  For example, in Windows Explorer, if you select a tree node, the node is highlighted in a dark blue.  If you were to then place the cursor in the Address box, the selected node changes to have a beige color.  This still shows which node was selected.

Is there a built-in solution (ie some property to set on the tree view or nodes) that would help fix my issue or do I have to build my own solution to mimic something like what Windows Explorer does?  I wanted to avoid having to put event handlers on all tabs and form fields that would be used to &

creating dynamic mini representation of the Active directory tree.

First of all I would like to thank Dunnry for the great output he has provided to almost any post in this forum. I see he has helped almost all of. Also the link with the vb.net web resources he has provided in some of his posts is great. Now I know how to pretty much do anything I need for my project, except one last thing.

In my web interface with active directory I would like to create a represantation of the active directory tree. I would like a user to be able to click on one OU and then get all the child OU listed under that OU and (etc). At the end he/she would be able to create a user in the final OU. I first thought that would not be such a big deal I could use a bunch of nested datagrids or datarepeaters and the result would look like somewhat real structure of active directory. I already built an array and then populated with the names and bounded to a datagrid, just to see if it works, it does. I spent hours online looking for some information or ideas, but I could not find anything. All I found is one javascript, I have not had time to look at the code, but I doubt it that it is server based. I could use the datagrids and repeaters, but the problem is that our tree is huge and different containers have different number of children. It sounds insane to have for example five nested datagrids I don't even want to think about all the code I woul

Drag and drop to windows explorer of SharePoint site leads to 0KB file


I believe this issue got by so many people already.

We have a sharepoint site running on HTTPS protocol. There are some scenarios we get multiple documents from customers and need to move them to SharePoint to share them across organization. For this, what we are doing is, we are opening the library and from Actions menu -> Open in Windows Explorer.

The windows explorer is opening fine and when we tried to move the files from local system to windows explorer of the SharePoint site, it is failing to copy data and showing 0KB moved. And at the windows taskbar it is giving notification like "Got network delayed write fail message." when we are doing this on XP. On any other OS, there is no notification and not moving the file.

We are not able to understand the problem. Why it is not able to move, everytime it is copying 0KB.

We can do using upload multiple files feature, but we have to go back and forth between folders and it will slow down the process.

Please help me out, why it is happening... It is not network issue at all for sure.


ASP.NET and SharePoint developer
Company: http://www.rampgroup.com/
Blog: http://praveenbattula.blogspot.com
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend