How can I copy a datagridview to a gridview.. I only ask b/c I need to use the rendercontrol and its not available using datagridview. And Gridview is not an option for me to use in a windows application.. BUT the class is.. very odd but anyway. All the colors formatting etc.. I need to pass to the gridview. Any ideas?

Recommended Answers

if you mean copy value from DGV1 to DGV2, here is what i do :

DataGridView2.Rows.Clear()
For i As Integer = 0 To DataGridView1.Rows.Count - 2
   DataGridView2.Rows.Add(DataGridView1.Rows(i).Cells(0).Value)
Next

NOTE :
1. Allow user to add row
2. i do that with just one column, so if …

Jump to Post

All 2 Replies

if you mean copy value from DGV1 to DGV2, here is what i do :

DataGridView2.Rows.Clear()
For i As Integer = 0 To DataGridView1.Rows.Count - 2
   DataGridView2.Rows.Add(DataGridView1.Rows(i).Cells(0).Value)
Next

NOTE :
1. Allow user to add row
2. i do that with just one column, so if you want do that to spesific column, you may change Cells("?")

Kind of I think. I just want to copy the DataGridView to a Gridview so I can use the rendercontrol method.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.