[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Collapse]CodeRush
  System Requirements
  Improve Performance
 [Expand]Features by Language
 [Expand]Getting Started
 [Expand]How To
 [Expand]Coding Assistance
 [Expand]Navigation and Search Tools
 [Expand]Static Code Analysis
 [Expand]Visualization Tools
 [Collapse]Code Style Assistance
  [Expand]Code Formatters
   Programming Style Rules
   Naming Conventions
  [Expand]Code Cleanup
   Remove Unused Assembly References
  [Collapse]Document Formatting (C#)
    General
    Blank Lines
    Braces
    Spacing
    Wrapping
    Other
   Document Formatting (XAML)
   Member Organization
   Move Member to Region
  Building Assistance
  Debugging Assistance
 [Expand]Refactoring Assistance
 [Expand]Unit Testing Assistance
 [Expand]Decompiling Tools
 [Expand]Configuration Options
 [Expand]Extensibility
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Document Formatting (C#)

Document Formatting allows you to enforce code formatting aspects unavailable in the Visual Studio's Code Formatting feature.

Expanded Execute Format Document Action

You can execute the Format Document action in one of the following ways:

  • Check Apply in Action and Apply on Save for the "Format document" rule on the Editor | C# | Code Cleanup options page and execute a Code Cleanup.

  • Enable "Format block on }" and/or "Format statement on ;" options on the Editor | C# | Formatting | General options page to maintain formatting as you type.

  • Create a new shortcut and bind it to the "FormatDocument" command.

    The following screencast shows how the Ctrl+G shortcut initiates a Document Formatting action:

Expanded Document Formatting Options

Use the preview box at the bottom of the Editor | C# | Formatting options page to see an example of every item.

Is this topic helpful?​​​​​​​