Dynamic GridView and DataList in ASP.NET 2.0
page 1 of 10
Published: 29 Jan 2008
Abstract
Sometimes we may be required to build GridView and DataList dynamically with different styles and with child controls in our project. This article will help you accomplish this task in ASP.NET 2.0 with the help of a case study. Satheesh first provides a brief overview of the scenario and then explores the step-by-step implementation of each module with supported source code. The steps include creation of a Template class, implementation of a dynamic DataList, using the Template class in DataList, implementation of a dynamic GridView, and the usage of Template class in GridView. The article is accompanied by the related Visual Studio project which enables you to instantly test drive the application.
by Satheesh Babu
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 38827/ 624

Introduction

Displaying tabular data to the users is one of the common tasks we will perform in any site we build. In ASP.NET 1.x we make use of the DataGrid, DataList and Repeater controls most of the time depending on the need. With the introduction ASP.NET 2.0, we have GridView in the place of DataGrid with some changes that make the control more easily usable than DataGrid with the help of data source controls. Each time the need of displaying the data will be different. Sometimes, we will require the data to be displayed to the user where he/she should have edit/update/delete functionalities or we require displaying the data with the header being displayed in the left as opposed to top which makes us decide which of the above controls to use. Coming to our subject, most of the time it is sufficient if we drag the control into the WebForm instead of adding it dynamically to achieve the target. At times we will require doing this dynamically which I took to discuss in this article with both DataList and GridView control in ASP.NET 2.0.

Microsoft has designed both of the controls in such a way so that the developer can use the flexibility and can build it dynamically by giving dynamic styles and layouts to the data display. Moving forward I will explain a scenario where we can have a dynamic DataList/GridView and construct it.


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 2 and 6 and type the answer here:

User Comments

Title: yes   
Name: no
Date: 1/8/2009 4:43:25 AM
Comment:
no
Title: JSON LINQ   
Name: willian brasil
Date: 10/3/2008 1:18:03 PM
Comment:
Very Good!
Title: Data List   
Name: Deleep Kumar Pavana
Date: 9/11/2008 5:03:07 AM
Comment:
Hi satheesh,
Its good but repeat colomns property is not working properly on that,if i use table tag to display data in table format..
Title: Good Work ....   
Name: Mudassar C
Date: 7/17/2008 1:09:10 AM
Comment:
Hi Sateesh,
Its a really good article to read..
Good piece of Code..

Mudassar Chandle
Title: Data List And GridView   
Name: Santosh Kumar
Date: 6/24/2008 3:36:54 AM
Comment:
Hi Satheesh,
I read this article , good work done.
Santosh Kumar
http://www.operativesystems.com
Title: VB Please   
Name: Matt
Date: 6/3/2008 1:11:24 AM
Comment:
Any chance I can get this in VB?
Please
THanks
Matt
Title: problem with binding   
Name: Kannan
Date: 5/15/2008 2:51:40 AM
Comment:
All item template values displayed at once.no reapeated datalist display
Title: muhajiran bugok   
Name: muhajiran bugok
Date: 5/9/2008 6:43:36 AM
Comment:
this is very helpful..
-putang ina nyo lahat
Title: sivaram   
Name: sivaram
Date: 2/4/2008 1:47:59 AM
Comment:
Thanks.

hi i read your article.it is well and good article.

Product Spotlight
Product Spotlight 
Learn More
.NET Tools
asp.net shopping cart
asp.net chart control






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2009 ASPAlliance.com  |  Page Processed at 1/8/2009 7:16:56 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search