Mohsin

Mohsin

  • NA
  • 2
  • 0

how to Copy data of Datagridview?

Feb 25 2009 12:46 PM
I got data from database into my datagridview via sqlDatasource1 i.e by using given tools, no programming et all.
I want to access rows of each Gridview row separately and then show them in textboxes of my own choice, instead of in gridview. How can I do that?
It works
numberOfRows = datagridview.Rows.Count;

but following doesn't

textbox1.Text=datagridview.Rows[0].cells[1].Text;
Dont know why it doesn;t?

Then I tried to get data of this gridview to another but it didn;t work too.

Help me plzzz.....I m struck here
Regards,
Mohsin
[email protected]
I tried this, but it didn;t work
 
DataSet dataset = dgv.DataSource as DataSet;
            DataView dv = new DataView(dataset.Tables[0]);
            dgv2.DataSource = dv;
            dgv2.DataBind();