Click here to Skip to main content
15,919,749 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a form with 2 DataGridViews - DataGridViewS and DataGridViewL. They both have the same amount of columns(11) and the column headers are the same except for the first column(s). I need to be able to copy a selected row from one DataGridView to the other w/o the first column, but still have the other columns correspond. If this is not possible, I would settle for copying the entire selected row. I'm also having problems sorting the first column. It's data is numbers(milliseconds) and when I sort the column, a value of 1113 is below 11130. The order(ascending/descending) is correct, so I'm figuring it's the format of the data. I'm using convert to Int32 on the data(milliseconds) before it's entered into the DataGridView. I'm new at programming and this is beyond my knowledge, any help would be greatly appreciated!
Updated 22-Feb-12 3:57am

1 solution

The GridViews are bound to a datasource so you don't copy from the grids you copy from the datasources. You can use an event, such as rowindexchanged, to get the current row and index in the datasource then copy to the other grid's datasource.
Share this answer

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