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(dtColo rs);
ArrayList ColorIDList = new ArrayList(dvCol ors.Count);
Int32 i;
for (i = 0; i <= dvColors.Count - 1; i++)
{
ColorIDList.Add (dvColors[i]["ColorExtIn tID"]);
}
Int32 x = fpSpread1.Activ eSheet.ActiveRo w.Index;
// this is the invalid cast where I get an exception
string[] sColorIDList = (string[])ColorIDList.To Array(typeof(In t32));
.....
}
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(dtColo rs);
ArrayList ColorIDList = new ArrayList(dvCol ors.Count);
Int32 i;
for (i = 0; i <= dvColors.Count - 1; i++)
{
ColorIDList.Add (dvColors[i]["ColorExtIn tID"]);
}
Int32 x = fpSpread1.Activ eSheet.ActiveRo w.Index;
// this is the invalid cast where I get an exception
string[] sColorIDList = (string[])ColorIDList.To Array(typeof(In t32));
.....
}
Comment