Groups | Blog | Home
all groups > asp.net datagrid control > july 2005 >

asp.net datagrid control : How to insert a row in a DataGrid in code?


Bill
7/13/2005 3:07:57 PM
I thought I could insert a new row in a DataGrid in code by calling

CurrencyManager.AddNew;

but it does not work. I want to open a new row that the user will then
fill in. What am I missing?

--
Fiaz Ali Saleemi
7/13/2005 9:27:05 PM
Hi Bill

Create a new row using DataGrid's DataSource. Get the datasource and add a
new row in the table of
that data source then set the edit index to the index of that row in the
table (index will be
dataTable.rows.count -1 in C# and dataTable.rows.count in VB).

Regards
Fiaz Ali Saleemi

[quoted text, click to view]

AddThis Social Bookmark Button