This is a follow up question to Design issues and implementing Enumerable.AsEnumerable<FarPoint.Win.Spread.Row>
I have casted my farpoint row to a 2 d object array like this:
object[,] nthRow = fpSpread2.ActiveSheet.GetArray(e.Row, e.Column, 1, FarPointSpread1.ActiveSheet.ColumnCount);
I try to cast this to string so that i can apply Linq but i get the following error at runtime:
IEnumerator<string> narry = (IEnumerator<string>)nthRow.GetEnumerator();
Unable to cast object of type 'ArrayEnumerator' to type 'System.Collections.Generic.IEnumerator`1[System.String]'.
How can i resolve this problem?
Even for multidimensional arrays you can call
Cast<T>
on it.But each element in the array should actually be type
string
. If you want to do formatting likeToString()
, you can first cast them intoobject
and then callSelect<T>
.