I'm trying to do a cast and I'm not sure where I'm going wrong here. I load
up the ColorExtIntID column (int) into a list array (no problem there). For
binding to a 3rd party component, it has to then be cast to a string array.
private void PopulateColors()
{
DataView dvColors = new DataView(dtColors);
ArrayList ColorIDList = new ArrayList(dvColors.Count);
Int32 i;
for (i = 0; i <= dvColors.Count - 1; i++)
{
ColorIDList.Add(dvColors[i]["ColorExtIntID"]);
}
Int32 x = fpSpread1.ActiveSheet.ActiveRow.Index;
// this is the invalid cast where I get an exception
string[] sColorIDList = (string[])ColorIDList.ToArray(typeof(Int32));
.....
}