Situation :
I have a List<DataGridView> temp
. I need to pass a specific index to a function by reference, because I loop through them and I need to change the one affected. Here are the methods I tried/used
Method 1
functionA(ref temp[0]);
A property, indexeur or access to a dynamic member cannot be passed as ref or out (free traduction)
However that I can do :
Method 2
DataGridView bobu = temp[0];
functionA(ref bobu );
And this work. Would there be a way to use my method 1 instead of using a trick like in method 2?