Posted 12 October 2024, 9:44 am EST
I’m using the following code to open a child view based on the user’s click:
sv = GetSpreadView(FpSpread3.GetRootWorkbook().GetActiveWorkbook(), e.X, e.Y);[
public FarPoint.Win.Spread.SpreadView GetSpreadView(FarPoint.Win.Spread.SpreadView sv, int x, int y)
{
try
{
Rectangle r = sv.Bounds;
FarPoint.Win.Spread.SpreadView ret = null;
if (!r.Contains(x, y))
{
return null;
}
ArrayList al = sv.GetRootWorkbook().GetChildWorkbooks();
foreach (FarPoint.Win.Spread.SpreadView c in al)
{
if (ret != null)
{
return ret;
}
}
return sv;
}
catch (System.Exception Ex)
{
throw Ex;
}
}
This works well to get the correct child view, but now I would like to know which row in the root workbook corresponds to this child view. Is there any way to determine which row in the root is linked to the currently opened child view?
I use MouseDown event
Thanks in advance for your help!