WebForms in a DataGrid
page 1 of 3
Published: 17 Dec 2004
Unedited - Community Contributed
Abstract
I see an increasing amount of posts in the ASP.NET newsgroups about how to include drop-down lists or some other form of server control in a DataGrid. This article is designed to show you how to incorporate some of these server controls and give a few examples of their usage.
by . .
Feedback
Average Rating: 
Views (Total / Last 10 Days): 24925/ 66

The Setup DataGrid

Why use web forms?

The most obvious place for using web forms in a DataGrid is for editing. It can give you stricter control over the data that you can input, but you are not just limited to editing. I'll show you throughout this article where you can put them in for normal viewing.

Before we begin

For all of these examples we'll be using the following DataGrid -

<asp:DataGrid id="dg" runat="server"
Bordercolor="black"
gridlines="vertical"
font-names="Arial"
font-size="10pt"
HeaderStyle-BackColor="#FFCC00"
ItemStyle-BackColor="#FFCC66"
AlternatingItemStyle-BackColor="#FFFFFF"
AutoGenerateColumns="False">
<Columns>
</Columns>
</asp:datagrid>

Live Demo

Note - To see the code used to create the datasource for all this, click here.

Note - You may need to add some event handlers later on.


View Entire Article

User Comments

Title: Data grid   
Name: manishsrivastava
Date: 2005-05-04 7:28:14 AM
Comment:
It is realy good for new users of asp.net & gide them how to work in right way.Continu providing codes i m greateful for that.
Title: nice content   
Name: mohit
Date: 2005-04-13 9:45:10 AM
Comment:
good content but u will have to work on your presentation buddy it is very cumbersome looking
Title: std   
Name: setiadi
Date: 2005-03-04 6:59:53 AM
Comment:
thank's for your information

Product Spotlight
Product Spotlight 





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


©Copyright 1998-2017 ASPAlliance.com  |  Page Processed at 2017-08-23 1:42:54 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search