Blogs

This Blog

Subscribe (RSS, Email)

Mehul Harry's DevExpress Blog

JavaScript, HTML 5, ASP.NET, DevExpress, ASP.NET MVC & WebForms, and News - Mehul Harry's DevExpress blog

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: http://mvc.devexpress.com

Read the latest news about DevExpress ASP.NET MVC Extensions

Download a free and fully-functional version of DXperience now: http://www.devexpress.com/Downloads/NET/

Follow MehulHarry on Twitter

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

Comments

du cunyi

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

March 17, 2011 10:22 AM

Mehul Harry (DevExpress)

Du,

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

March 17, 2011 2:49 PM

RH

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. :)

Thanks.

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,

Peter

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)

Paul,

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?

Thanks.

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 mharry@DevExpress.com. You can also follow him on Twitter: http://twitter.com/mehulharry
LIVE CHAT

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 info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

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