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.

AlanRank #669 · 3.6K reputationPosted Oct 26, 2007, 10:38 AM EDT
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];
j_sen2156 reputationPosted Oct 26, 2007, 11:13 AM EDT
oops..thanks.
i actually did that, but for my stupidity typed object[,] with out the ().