<a href="http://www.micropoll.com/akira/mpview/585320-168921">Click Here for Poll</a><a href="http://www.questionpro.com" title="online surveys">Online Survey</a><BR> | <a href="http://www.micropoll.com" title="Website Polls">Website Polls</a><BR> | <BR><a href="http://www.micropoll.com/akira/MicroPoll?mode=html&id=168921">View MicroPoll</A></div>

Visual Studio 2010!

Read now >

Windows Mobile Development Thoughts

Read now >

View Now
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.
ADVERTISEMENT
ADVERTISEMENT

 

ADVERTISEMENT
Master-Detail Nested Grids with DevExpress' ASPxGridView
By Paul Kimmel

Rate This Article: Add This Article To:

Master-Detail Nested Grids with DevExpress' ASPxGridView
( Page 1 of 5 )

Nested grids in ASP.NET are challenging for many developers to manage. Paul Kimmel shows you how to use the ASPxGridView to make life easier.

Introduction

Nested grids in ASP.NET are challenging for many developers to manage. How do I know? I have written several articles, created some videos, and answered hundreds of emails about nested grids using the Visual Studio .NET ASP GridView control. My responses and samples worked quite well, but coordinating multiple layers of nesting takes a bit of work and some attention to detail—that is, unless you are using DevExpress’ ASPxGridView.

The ASPxGridView from DevExpress supports nested grids automatically with almost no code. Using nested ASPxGridViews to any level of nesting can be configured at design time in the IDE by setting properties and writing a single line of code.

DevExpress has videos at tv.devexpress.com that visually show you how nesting is achieved. The videos are informative, clear, and concise. In this article, the process is laid out in an orderly linear fashion with graphics. I mentioned the website because there are hundreds of videos on other subjects as well as this one.

Reviewing Grid Nesting

As your intrepid guide I know many of you are busy. It also helps to paint a target, so we all know where we are heading. Nested grids are generally employed when it is useful to show common master detail relationships. The word nested implies a grid in a grid, so that’s our objective.

Using the ASPXGridView from DevExpress to create a nested, master-detail effect you need to do these things:

  • You will need at least two tables; for this example use the Northwind Traders Orders and Order Details sample tables that come with SQL Server.
  • The example uses DevExpress ASP.NET controls version 8.3; you will need two SqlDataSource components and two ASPXGridView controls.
  • The SqlDataSource controls point at the table data via a query, and the ASPxGridView controls point to the SqlDataSource controls.
  • The second ASPxGridView is placed in the DetailRow template of the first ASPxGridView.
  • Change two property settings and correlate the master and detail records with a session value and you are finished.

Because the DevExpress ASPxGridView is a feature-rich control and the properties you need to set are very specific, let’s walk through configuring the nested relationships and elaborate on the individual steps.



 
 
>>> More Microsoft and Visual Studios Add Ons Articles          >>> More By Paul Kimmel