How to insert a row in a DataGrid in code?

B

Bill

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?
 
F

Fiaz Ali Saleemi

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top