Reputation: 699
I know i can assign gridview by:
public static DataGridView grid = new DataGridView();
but i want an array
Upvotes: 1
Views: 314
Reputation: 19591
Something like this
List<DataGridView> Grids = new List<DataGridView>();
// Assigning new DataGridViews
for (int i = 0; i < 5; i++)
Grids.Add(new DataGridView());
// Fetching one
DataGridView fetched = Grids[2];
Upvotes: 1
Reputation: 697
try
public static List < DataGridView > grids = new List < DataGridView > ();
Upvotes: 0
Reputation: 37566
did you try:
DataGridView [] myArray = new DataGridView [5];
myArray[0] = new DataGridView();
// ...
Upvotes: 0