how to get data from datagird ???

I code a small application using datagird to store data.....
my app have 2 button.....
First button dynamix create a datagird using datatable ......then I type some data in datagird...
Second I want to get these data from datagird to Datatable or can I do this..???

I don't want use dataset...
Who is Participating?

Improve company productivity with a Business Account.Sign Up

dsaboConnect With a Mentor Commented:
That line should be:

DataTable db= new DataTable();
db=(DataTable) DataGird1.DataSource;

hope it helps,
From the sounds of it, I'm assuming you're using windows forms, not web forms.  If so, the datatable will already contain the data entered in the grid.

Can you post your code for

<< First button dynamix create a datagird using datatable >>

If I'm understanding you properly, then datatable you're using will automatically be filled with data as you enter it into the grid.
sonbinaryAuthor Commented:
I use windows Form
I want to know "how to get data when I type data on datagird" know.....I don't use database....I just create a datagird, type something on datagird and I want to save these datas to datatable on onece click button.......
sonbinaryAuthor Commented:
I can't code this line :  
DataTable db= new DataTable();
db=DataGird1.DataSource; //----->> I want to get data on Datagird but I can't do that.....
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.