Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

adding new row to datagrid

Posted on 2004-09-22
4
Medium Priority
?
217 Views
Last Modified: 2010-04-23
Hi

 Initially i am displaying dropdownlist, button, textbox in datagrid. when the user click add new row
 I want to add a new row to datagrid again with dropdownlist, button , textbox.

any idea how to do this

thanx
sandeep
0
Comment
Question by:sandeep437
4 Comments
 
LVL 10

Accepted Solution

by:
123654789987 earned 1000 total points
ID: 12130252
See the following link to add controls to u datagrid

http://www.4guysfromrolla.com/webtech/050801-1.shtml

To create a new row

DataTable1 = datagrid.DataSource
DataRow row = DataTable1.NewRow();

row = DataTable1.Row(0).ItemArray();  //This copies the whole structure of row 0 of the new row. Then u change the values of some column values that are different.

row("FirstColumn") = "sfsdf"

DataTable1.Rows.Add(row);

DataGrid1.Databind();
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Screencast - Getting to Know the Pipeline

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question