0
I have a button and command and when I click it, I need to copy all the information from my datagrid to an Arraylist. For example: The datagrid has 4 columns and 10 rows all have information, now comes my dilemma, when clicking on the batão need to copy all datragrid to an arrylista. I’m using the following Cód.
ArrayList Array = new ArrayList();
foreach (DataGridViewCell item in dgvCompeticao.CurrentRow.Cells)
{
Array.Add(item.Value);
}
But this Cód is only copying the line
Already tried to add columns in the code as well?
– PauloHDSousa
Do you want to copy all the lines to the list? Or do you want to copy all the cells from all the lines? If it is the second, how will the cells be organized inside the list? Do you have a list list? I warn you to use
List
in place ofArrayList
. Not that it affects your problem, it affects all your problems.– Maniero