I have a rather simple question.
I have two Arraylist's and I need to add them both at the same time into a DataGridView.
Here is the basic code I used:
Expand|Select|Wrap|Line Numbers
- protected ArrayList fPath = new ArrayList();
- protected ArrayList md5File = new ArrayList();
- ...
- foreach (string fp in fPath)
- {
- foreach (string md5 in md5File)
- {
- int rw1 = dataGrid.Rows.Add();
- int rw2 = dataGrid.Rows.Add() - 1;
- //Array file path
- dataGrid.Rows[rw1].Cells[0].Value = fp;
- //Array md5
- dataGrid.Rows[rw2].Cells[1].Value = md5;
- }
And I think that this function is quite a ram eater.
So I deiced to make this better.
I wanted to create a two dimensional arraylist - so it could size up dynamically.
Expand|Select|Wrap|Line Numbers
- protected ArrayList[,] both = new ArrayList();
- both[0,x] = fpath values
- both[2,0] = md5File values;