Daniel
Daniel

Reputation: 16216

Visual Studio File Groupings

In Visual Studio 3 files are typically grouped together:

  1. filename.aspx
  2. filename.aspx.cs
  3. filename.aspx.designer.cs

Is there a way to add another file that grouping so that it can be collapsed and out of view?

  1. filename.aspx
  2. filename.aspx.cs
  3. filename.aspx.designer.cs
  4. customfile.cs

Thanks

Upvotes: 2

Views: 347

Answers (3)

Jarek Kardas
Jarek Kardas

Reputation: 8455

I've created a Visual Studio adding that does it (and more). It works with VS 2008 and 2010 and you can check it out here: http://mokosh.co.uk/vscommands

Upvotes: 2

Daniel
Daniel

Reputation: 16216

Here's the xml (corresponding to the example)

<Compile Include="customfile.cs">
  <DependentUpon>filename.aspx</DependentUpon>
</Compile>

Works like a charm.

Upvotes: 0

John Saunders
John Saunders

Reputation: 161773

If you open the .csproj file, you'll see how it's done. Try following the pattern to add your new file.

For example:

<Compile Include="Default.aspx.cs">
  <DependentUpon>Default.aspx</DependentUpon>
  <SubType>ASPXCodeBehind</SubType>
</Compile>

Upvotes: 3

Related Questions