Home - Forums-.NET - FlyGrid.Net (Windows Forms) - finding out a cells coordinates on the screen

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

finding out a cells coordinates on the screen
Link Posted: 28-Apr-2006 11:42
I need to be able to find out the X and Y coordinates of a cell on the screen so that I can open a popup menu under the cell when the user clicks on it.  How can I do this?

Thanks,
Scott
Link Posted: 02-May-2006 08:59
Use following code to determine cell coordinates (on FlyGrid without nested grids):
[c#]
private Rectangle GetCellRect(FlyGrid flyGrid, NodeBase node, Column column)
{
  FlyGridViewPort viewPort = flyGrid.ActiveRootPort;
  int row = viewPort.Rows.GetRowFromNode(node);
  if (row != -1) //node is visible
  {
    int col = viewPort.Columns.GetColumnCellIndex(column);
    if (col != -1)//column is visible
    {
      return viewPort.GetRectangle(viewPort.Bounds, row, col);
    }
  }
  return Rectangle.Empty;
}