I have a gridview1 with 2 columns A and B, and I want to be able to copy those columns into gridview2, which has 3 columns A B and C, where A and B have the same headings as A and B in gridview1. How do I do this in C#?
Asked
Active
Viewed 710 times
1
-
for loop? Is this a trick question? – stark Apr 05 '12 at 03:29
-
what is gridview1 datasource? – slawekwin Apr 05 '12 at 06:46
1 Answers
0
If you are dynamically binding gridview1 with the datatable, then you can add the column C to the datatable and bind it to gridview2.
If you dont have the datatable then you can try converting the gridview1 data to datatable and add the coulmn C and then bind to gridview2.
as in post: How can I export a GridView.DataSource to a datatable or dataset?