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

16 March 2011

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

15 comment(s)
du cunyi

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

17 March, 2011
Mehul Harry (DevExpress)


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

17 March, 2011

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

17 March, 2011
Mehul Harry (DevExpress)

Thanks Brett!

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

17 March, 2011
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 :)...

20 March, 2011
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. :)


21 March, 2011
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 :)

25 March, 2011
Peter Gabris

Congratulations! Delivered as promised.

Best regards,


31 May, 2011
Mehul Harry (DevExpress)

Thanks Fathir Mohamad!

1 June, 2011
Mehul Harry (DevExpress)

Thanks Peter!

1 June, 2011
Paul Brady 1

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

10 January, 2012
Mehul Harry (DevExpress)


Use the GridView.DetailRows.ExpandAllRows method.

19 January, 2012
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?


10 February, 2012
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.

10 February, 2012
Mehul Harry (DevExpress)
10 February, 2012

Please login or register to post comments.