Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi can anyone help and share idea of whether is it possible to add a new row with some data to datagridview on button click. For eg I should display some data on the newly added row like 'SP_' and then user should continue writing after that. SP_UserLogin.
Another question is an empty row is added whenever I enter data in the newly added row. how to get rid of that
Posted
Updated 28-Aug-11 21:12pm
v2
Comments
Simon Bang Terkildsen 29-Aug-11 3:40am    
Winforms, WPF, ASP.NET? Update your tags please

1 solution

Try adding using DataTable.NewRow. Refer the link hope it might help you

http://msdn.microsoft.com/en-us/library/system.data.datatable.newrow.aspx[^]
 
Share this answer
 
Comments
Anuja Pawar Indore 29-Aug-11 4:12am    
For handling empty entry pls refer http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.rowsadded.aspx#Y504

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900