Article Home | Computers | news | Category | Special | GuestBook | Contribute | Search
Current: Article Home >> Computers >> Programming >> Custom Data Grid with Field Chooser functionality

Custom Data Grid with Field Chooser functionality

2007-11-26 18:49:23  Author: GKris  Source: codeproject.com  Click: 13  Text Size: [A] [A] [A]
Intro: Figure - Custom Data Grid with all fields from product table Figure - Field chooser dialog Figure - Custom Data Grid without ProductId field Figure - Product Name back Color ...

Custom Data Grid with all fields from product table

Figure - Custom Data Grid with all fields from product table

Field chooser dialog

Figure - Field chooser dialog

Custom Data Grid without ProductId filed

Figure - Custom Data Grid without ProductId field

Product Name back Color changed

Figure - Product Name back Color changed

Introduction

This custom data grid allows the user to select the columns to be displayed, change the columns order as needed at runtime. This grid will display a Field Chooser context menu when you click on the column header row which when selected will display a Field Chooser dialog box where the user can choose, exclude and re-arrange the grid columns. User may also wish to change the back color of a column. Background

I had to develop a custom data grid for a project where the user should have an option to choose the columns to be displayed and change the order of the columns as needed (just like outlook, although it was done using a list view). So, I thought it would be a good idea to extend the basic data grid and add some functionality to it.

I am sure that there would be a better way to implement this feature and would like any comments or suggestions on this. Using the code

In this example, the CustomGrid displays the Product Table contents from the Northwind database. I used DataTable as a DataSource to the grid. You may wish to use any other source such as DataSet or DataView but you need to make changes to the grid control code.

Admin: licici_1


 
 
 
Google Link
New Articles
More >
· Dynamic Reports UsingSQL Q...
· Use of custom attributes t...
· Data binding concepts in ....
· ADO.NET and UDL
· Caching Data in WinForms D...
· Article 2 - Display data u...
· Implementing a Provider In...
· Data Access Layer (Part I)
· Custom Data Grid with Fiel...
· Runtime Connection Wizard