Click here to Skip to main content
15,908,015 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want all the rows and column in my DataGridView in DataTable. how can i achieve this with minimum code.
Plz let me know.

thax..
Posted

1 solution

How are you populating your DataGridView?
If you are expecting the user to fill in some values populate it with an empty DataTable and the DataGridView will update it as the user enters the data.
 
Share this answer
 
Comments
Member 7849016 17-Apr-11 12:12pm    
how can We do that? i am having a DataGridView that Filled by user inputs in textboxes. Now i want this values from DataGridView to DataTable..
Fabio V Silva 17-Apr-11 12:17pm    
Create a new DataTable and set it as the DataGridView.DataSource property.
You'll have to add the necessary columns on this DataTable and set the DisplayMemberBinding of each of the DataGridViewColumns to the corresponding column on the DataTable. After the users finished his inputs you'll have the DataTable updated with all the data.

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