2
Answers

2-d array with an arraylist

j_sen21

j_sen21

17y
2.2k
1

Hello, Im creating a arraylist of arrays. The arrays inside is a array in this form: object[Control, int]

Having problems pulling the information  out. THanks

 

Creation:

ArrayList configureList = new ArrayList();

Object[,] configureValues = new Object[2,2];

----

Adding:

configureValues[0, 0] = txt1;

configureValues[0, 1] = 2;

configureList.Add(configureValues);

---------------

Trying to retreive:

object[,] retrieved = configureList[i];

Control ct = (Control)retrieved[0,0];

int temp = (int)retrieved[0, 1];

 

Thanks again.

 

Answers (2)