Click here to Skip to main content
Click here to Skip to main content
Go to top

Fully functional Nested DataGrid

, 13 Mar 2006
Rate this:
Please Sign up or sign in to vote.
This application will help you to build a datagrid within a datagrid with all options like Edit, Delete and Add functionality.

Introduction

 This article will explains all the functionality of a Nested Datagrid. There are following funtionalities in the applcation :

1) Add / Edit / Delete functions for parent and child datagrids.

2) Tree view for parent datagrid.

3) validation for adding data.

Sample screenshot

Objective :

  Most of the datagrid applications are used for displaying data only. So I thought of adding the functionality (Add, Edit, Modify, Tree View) in the datagrid.

Database :

   Northwind database has been used for the ease, but you need to create two tables to run the application. Database script for the table creation is included in the zip file. The two tables used are :

1) Custs

2) Ords

 Design :

  There are two datagrids in the application, 'dgCustomer' and 'dgOrders'. 'dgCustomer' is a parent datagrid and the child datagrid 'dgOrders' is generated based on the primary key of records of 'dgCustomers'.

Events & Methods Description :

   BindData method is used for binding dgCustomer datagrid.

   dgCustomer_ItemDataBound event is used to bind orders datagrid.

   dgCustomer_ItemCommand event is used for delete & add commands of customer datagrid.

   dgCustomer_EditCommand event is used to edit data of customer datagrid.

   dgCustomer_CancelCommand event is used to cancel edited data of customer datagrid.

   dgCustomer_UpdateCommand event is used to update edited data of customer datagrid.

   dgCustomer_ItemCreated event is used to register orders datagrids events.

 

   bindOrderData method is used for binding dgOrders datagrid.

   dgOrders_ItemDataBound event is used to bind orders datagrid.

   dgOrders_ItemCommand event is used for delete & add commands of Orders datagrid.

   dgOrders_EditCommand event is used to edit data of Orders datagrid.

   dgOrders_CancelCommand event is used to cancel edited data of Orders datagrid.

   dgOrders_UpdateCommand event is used to update edited data of Orders datagrid.

 

 

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Dinesh Goziya
Web Developer
India India
I am a software engineer working for Microsoft Software Private Limited at Cybage Software Private Limited Pune. I have 3 Years of experience in ASP.NET and .NET Compact framework.

Comments and Discussions

 
QuestionUrjent Query regarding nested grid Pinmemberdilfizo2-Apr-12 1:11 
GeneralMy vote of 3 Pinmemberrkumar6709-Oct-11 19:03 
QuestionJScript Error PinmemberHariSir28-Nov-07 14:23 
AnswerRe: JScript Error PinmemberNadene17-Aug-09 1:58 
GeneralSetting 'Collapse' as the default when the page loads Pinmemberrabing23-Dec-06 20:00 
Generalerror while using inside usercontrol PinmemberGayuDams11-Nov-06 0:59 
GeneralRe: error while using inside usercontrol PinmemberDinesh Goziya12-Nov-06 18:47 
GeneralRe: error while using inside usercontrol PinmemberGayuDams12-Nov-06 19:04 
GeneralRe: error while using inside usercontrol PinmemberGayuDams14-Nov-06 17:22 
GeneralBinding DataList Within A DataGrid Pinmembermshariq12-Jul-06 3:47 
Questionhow can I make " dgCustomer" collapse as default case! not expand when i pagelod the page!! Pinmembertiger6015-Jun-06 17:40 
AnswerRe: how can I make " dgCustomer" collapse as default case! not expand when i pagelod the page!! Pinmembertiger6015-Jun-06 17:41 
GeneralRe: how can I make " dgCustomer" collapse as default case! not expand when i pagelod the page!! Pinmemberrabing23-Dec-06 19:57 
AnswerRe: how can I make " dgCustomer" collapse as default case! not expand when i pagelod the page!! Pinmembermrhamedn7-Feb-07 0:59 
AnswerRe: how can I make " dgCustomer" collapse as default case! not expand when i pagelod the page!! Pinmembermrhamedn7-Feb-07 1:01 
AnswerRe: how can I make " dgCustomer" collapse as default case! not expand when i pagelod the page!! Pinmembermrhamedn7-Feb-07 1:02 
AnswerRe: how can I make " dgCustomer" collapse as default case! not expand when i pagelod the page!! PinmemberMember 132196630-Jul-08 9:50 
Questionwhere is the article ? Pinmemberv2.013-Mar-06 4:39 
AnswerRe: where is the article ? PinmemberRama Krishna Vavilala13-Mar-06 4:48 
GeneralRe: where is the article ? Pinmemberv2.013-Mar-06 4:51 
GeneralRe: where is the article ? PinmemberMarcello13-Mar-06 9:39 
GeneralRe: where is the article ? PinmemberHardikP15-Mar-06 3:10 
GeneralRe: where is the article ? PinmemberDinesh Goziya15-Mar-06 17:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140922.1 | Last Updated 13 Mar 2006
Article Copyright 2006 by Dinesh Goziya
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid