Collapsing Related Files in Visual Studio

In Visual Studio as most of you will have noticed that related file can be collapsed in to one. E.G.

  • Form1.cs
    • Form1.Designer.cs

I'm creating a DAL library and will be splitting partial classes in to several files such as:

  • SomeTableClass.cs
    • SomeTableClass.Generated.cs
    • SomeTableClass.SomethingElse.cs

Is there any way in Visual Studio to recognise these file are related to each other an create the collapsible effect?




In my (VisualStudio 2005) system, they are stored in the registry under


For VisualStudio 2008, change the \8.0\ to \9.0\

Note, however, that the GUID in the middle refers to the type of project (VB Console, C# Web, etc) it is. You may have to poke around to find the right one for you.

In VS 2008, there is also a project file-level way to do this via the DependentUpon tag. You would edit your project file to look like this:

<Compile Include="SomeTableClass.cs" />
<Compile Include="SomeTableClass.Generated.cs">

In my Windows 7 x64 environment, the registry keys for Visual Studio 2008 Professional are located here:


In Visual Studio 2012, they are to be found in the HKCU, i.e.:


A useful VS plugin has since popped up that takes care of this problem for me: NestIn

Need Your Help

How to quit iPhone webapp programatically

ios iphone web-applications

I want to make a couple buttons on my iPhone to control my stereo. I thought I might be able to do this by putting a couple webpages on my homescreen that issue stop, play, next, etc requests to my...