I am trying to inherit the FarPoint.Win.Spread.FpSpread
class and implement IEnumerable<FarPoint.Win.Spread.Row>
so that i should be able to apply linq on FarPoint spread rows or cells. I tried multiple ways but i keep getting errors:
class myspread : FarPoint.Win.Spread.FpSpread, IEnumerable<FarPoint.Win.Spread.Row>
{
public IEnumerator<FarPoint.Win.Spread.Row> GetEnumerator()
{
return myspread.GetEnumerator();// Error on this line
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
Second try:
class myspread : FarPoint.Win.Spread.Row, IEnumerable<FarPoint.Win.Spread.Row>
{
public IEnumerator<FarPoint.Win.Spread.Row> GetEnumerator()
{
return myspread.GetEnumerator();// Error on this line
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
Third try:
class myspread : FarPoint.Win.Spread.Cells, IEnumerable<FarPoint.Win.Spread.Cells>
{
public IEnumerator<FarPoint.Win.Spread.Row> GetEnumerator()
{
return myspread.GetEnumerator();// Error on this line
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
I want to be able to apply linq on a lot of objects on a FarPoint sheet
Now the above data could be in lacs - i need to do a lot of formatting on the above data and update values on some conditions. How can i achieve this?
In all cases you indicate that the following line is generating the error:
Without knowing more about your code we can't really get to the bottom of this. It looks like you're trying to call the
GetEnumerator
method statically on themyspread
class, which is probably not what you'd like it to do.I assume that you want your class to provide enumeration over the rows in the active sheet. Looking at the documentation here, and specifically the docs for the
Rows
collection, I'll make some guesses about how it might look:Of course if the
Rows
collection implementedIEnumerable<Row>
then this would be simply a matter of doing:The FarPoint documentation doesn't indicate any support for
IEnumerable<Row>
in the collection however.