Mehul Harry's DevExpress Blog

This Blog


Mehul Harry is the DevExpress Web Program Manager. Follow him on twitter: @Mehulharry

Subscribe (RSS, Email)


ASP.NET MVC GridView - Master-detail Grid Layout (available now in v2011.1)

Check out the new "Master-detail" layout feature of our ASP.NET MVC GridView that's available now in the DXperience v2011.1 release!:

ASP.NET MVC_GridView_Master_Detail

Unlimited Levels

Our ASP.NET MVC Grid View will support master-detail data presentation of any complexity. Which means that you can nest GridViews as deep as you need or want.

How-To Setup

The demo above shows how to create a simple master-detail relationship between two tables. All you have to do is to:

  1. Use two DevExpress MVC GridView extensions
  2. Bind the first grid (master grid) to the master data source and enable the grid's SettingsDetail.ShowDetailRow option
  3. Place the second grid (detail grid) into the master grid's detail row template created via the SetDetailRowTemplateContent method
  4. Assign a unique (dynamically generated) name to the Name property of the detail grid and set its SettingsDetail.MasterGridName property to the master grid's name
  5. Bind the detail grid to the detail data source whose data is retrieved in a controller action based upon the corresponding master row ID passed via a ViewData parameter

By default, end-users can expand several master rows simultaneously. You can control this behavior using the SettingsDetail.AllowOnlyOneMasterRowExpanded option.

Available now in v2011 Volume 1 Release

The new "Master-Detail" feature is available now in the DXperience v2011 volume 1 release.

Are you looking forward to using the Master-Detail layout for your DevExpress MVC GridView?

Drop me a line below with your thoughts, thanks.


Build Your Best - Without Limits or Compromise

Try the DevExpress ASP.NET MVC Extensions online now:

Read the latest news about DevExpress ASP.NET MVC Extensions

Download a free and fully-functional version of DXperience now:

Follow MehulHarry on Twitter

Published Mar 16 2011, 09:15 AM by
Bookmark and Share


du cunyi

great,you means the DXperience v2011 volume 1 will be released at April?

March 17, 2011 10:22 AM

Mehul Harry (DevExpress)


The DXperience v2011 vol 1 should be released around the May/June 2011 time frame.

March 17, 2011 2:49 PM


Perfect.  Just got into MVC, and this is the only option I was worried about losing by transferring over from WebForms.  Awesome work.

March 17, 2011 3:00 PM

Mehul Harry (DevExpress)

Thanks Brett!

There's more news coming for our DevExpress MVC GridView. Stay tuned to this blog. :-)

March 17, 2011 3:07 PM

Luke Grews

Hi Mehul,

"The DXperience v2011 vol 1 should be released around the May/June 2011 time frame." Does that imply two releases per annually?

Sorry can't wait to get my hands on the next release goodies,

wish it was sooner :)...

March 20, 2011 3:54 AM

Mehul Harry (DevExpress)

Hi Luke,

Yes, last year, Julian our CTO announced that we were moving to a 2 release cycle per year so that we didn't have to spend so much time on testing each release and more time for features/products. :)


March 21, 2011 7:13 PM

Fathir Mohamad

wow... great works. this is the feature that i want and need for my MVC development. can't wait to use that feature. same with Luke, wish it came sooner :)

March 25, 2011 2:29 PM

Peter Gabris

Congratulations! Delivered as promised.

Best regards,


May 31, 2011 11:19 PM

Mehul Harry (DevExpress)

Thanks Fathir Mohamad!

June 1, 2011 5:15 PM

Mehul Harry (DevExpress)

Thanks Peter!

June 1, 2011 5:15 PM

Paul Brady 1

Sweet.  What if I want all the detail rows to display by default?

January 10, 2012 12:25 PM

Mehul Harry (DevExpress)


Use the GridView.DetailRows.ExpandAllRows method.

January 19, 2012 3:47 PM

Norman Kleinberg

Just getting into this and trying to copy the code in the online demo. Unfortunately, using Html.RenderAction to "place" the detail gridview into the Template keeps throwing an exception, changing that to Html.RenderPartial with the second argument as stated tells me the DataSource is not of the correct type. Can you point me in the right direction?


February 10, 2012 12:07 PM

Norman Kleinberg

Sorry, just a followup, the issue MAY be that the Master grid is using server mode (i.e. BindToLINQ). I can't seem to find sample code for using Master-Detail in MVC3/Razor with BindToLINQ.

February 10, 2012 12:22 PM

Mehul Harry (DevExpress)

February 10, 2012 2:18 PM

About Mehul Harry (DevExpress)

Mehul Harry is an ASP.NET technical evangelist at Developer Express. You can reach him directly at You can also follow him on Twitter:

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at or call us at +1 (818) 844-3383


DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, Delphi, HTML5 or iOS & Android development. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2018 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners