To obtain flyGrid.ActivePort bounds extract from this object IObjectWithBounds interface:
private Rectangle GetBounds(FlyGrid flyGrid)
{
IObjectWithBounds owb = flyGrid.ActivePort as IObjectWithBounds;
return owb.Bounds;
}
Returned value doesn't reflect client size, to obtain client area use following code:
private Rectangle GetClientBounds(FlyGrid flyGrid)
{
Rectangle bounds = GetBounds(flyGrid);
if (flyGrid.ActivePort.HScrollBar.Visible)
bounds.Height -= SystemInformation.HorizontalScrollBarHeight;
if (flyGrid.ActivePort.VScrollBar.Visible)
bounds.Width -= SystemInformation.VerticalScrollBarWidth;
return bounds;
}