High-speed MVC Development in Visual Studio with CodeRush and DevExpress MVC Extensions

18 March 2011

If you saw our Using CodeRush with MVC webinar, Rory and I introduced new templates that make it easy to exploit the MVC Extensions from DevExpress. These templates will likely be integrated into CodeRush 11.1, however you can install and start using them right now (installation instructions appear below).

Templates

Controls

Template        Control                     
xb Button
xc Calendar
xcb ComboBox
xde DateEdit
xgv GridView
xhe HtmlEditor
xhl HyperLink
xi Image
xl Label
xlb ListBox
xm Menu
xmo Memo
xnb NavBar
xp PopupControl
xpg PageControl
xrb RadioButton
xrbl RadioButtonList
xrp RoundPanel
xs Splitter
xse SpinEdit
xtb TextBox
xte TimeEdit
xtv TreeView
xu UploadControl

Items, Nodes, Groups, Panes, and Tab Pages

These templates make it easier to create elements inside the MVC controls. Copy the reference that will own these elements (e.g., “settings”, “settings.Properties”,  “firstMenu”,  etc.) to the clipboard before expanding.

Template    Calls Use Inside              
ga Groups.Add() NavBar
ia Items.Add() ComboBox, ListBox, Menu, RadioButtonList
na Nodes.Add() TreeView
pa Panes.Add() Splitter
tpa TabPages.Add()    PageControl

Other Templates

Template    Expansion
xrs RenderScripts
xrss RenderStyleSheets

Installation

To install, follow these steps:

1. Right-click and save each of the templates below.

HTML_MVC_DevEx Extensions.xml
CSharp_ASP.NET_MVC_DevEx Extensions.xml

IMPORTANT:  For VB developers, we have two sets of templates to choose from.

2. Start Visual Studio if it’s not running already.

3. From the DevExpress menu, select Options.

4. Navigate to the Editor\Templates options page.

5. IMPORTANT: Change the Language combo box at the bottom of the Options dialog to HTML.

LanguageHtml

6. Right-click the template TreeView and choose Import Templates….

7. Select the HTML_MVC_DevEx Extensions xml file downloaded in step one, and click Open.

8. If you see a Category Exists warning message, click OK.

CategoryExists

Next, we need to install the templates for adding items, groups, nodes, panes, and tab pages. These templates must be imported into the appropriate language group of templates.

 

If You Work in Visual Basic…

1. IMPORTANT: Change the Language combo box at the bottom of the Options dialog to Basic.

LanguageBasic

2. Right-click the template TreeView and choose Import Templates….

3. Select the Basic_ASP.NET_MVC_DevEx Extensions xml file downloaded in step one, and click Open.

4. If you see a Category Exists warning message, click OK.

 

If You Work in C#…

1. IMPORTANT: Change the Language combo box at the bottom of the Options dialog to CSharp.

LanguageCSharp

2. Right-click the template TreeView and choose Import Templates….

3. Select the CSharp_ASP.NET_MVC_DevEx Extensions xml file downloaded in step one, and click Open.

4. If you see a Category Exists warning message, click OK.

 

Testing

After importing the MVC Extension templates as shown above, click OK to close the Options dialog. Inside an MVC application, open an aspx file, go to an empty line, and expand one or more of the templates on this page.

MVC TreeView expansion

4 comment(s)
mdx

Very cool. Thanks for the detailed instructions. It looks like the templates aren't quite smart enough to notice I'm using the razor view engine, however. Does this require a different set of templates?

18 March, 2011
Brent Seufert 1

I second Matthew K' ... Razor support ?  :)

25 March, 2011
Mark Miller (DevExpress)

Razor support is coming in CodeRush 11.1, expected some time Q2 2011. We're also working to get pre-release support for Razor out in a much shorter time frame. We'll keep you posted.

25 March, 2011
Brent Seufert 1

Thanks.  I started to change the templates, then discovered that CodeRush doesn't recognize .cshtml pages.  

Looking forward to the pre-release :)

25 March, 2011

Please login or register to post comments.