0

I have a DevExpress GridView in my WinForm. I am trying to open a custom form on mouse double click on the row. The form opens up fine, but I would like to position the pop-up form under the clicked row. How do I handle this. THis is how far I got:

private void GridMouseDoubleClick(object sender, MouseEventArgs e)
    {
        //DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo info = gv_ExpTrafficCounts.CalcHitInfo(e.Location);
        DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo info = gv_ExpTrafficCounts.CalcHitInfo(new Point(e.X, e.Y));
        if (info.InRow) {
            Point _rowLocation = info.HitPoint;                
            ShowPopupWindow(_rowLocation);
        }
    }
    private void ShowPopupWindow(Point _location)
    {
        PopupWindow _popUp= new PopupWindow(_location);            
        _popUp.ShowDialog(this);
         
    }

    Point windowLocation;
    public PopupWindow(Point _location)
    {
        InitializeComponent();
        this.windowLocation = _location;
    }
    public void PopupWindowShown(object sender, EventArgs e) {
        this.Location = new Point(windowLocation.X, windowLocation.Y + ???);
    }
SoftwareDveloper
  • 559
  • 1
  • 5
  • 18

0 Answers0