Click here to Skip to main content
Click here to Skip to main content

Fully functional Nested DataGrid

By , 13 Mar 2006
Rate this:
Please Sign up or sign in to vote.

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

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

 
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 

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
Web02 | 2.8.140415.2 | Last Updated 13 Mar 2006
Article Copyright 2006 by Dinesh Goziya
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid