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.
j_sen21Posted Oct 26, 2007, 3:13 PM
oops..thanks.
i actually did that, but for my stupidity typed object[,] with out the ().
AlanPosted Oct 26, 2007, 2:38 PM
When you add anything to an ArrayList, it is stored internally as a (single) object even if it's a two dimensional array of objects!
So, you need a cast to make the code work:
object[,] retrieved = (object[,])configureList[i];