CellDoubleClick strange behaviour.

Posted by: asystems on 8 September 2017, 3:20 pm EST

  • Posted 8 September 2017, 3:20 pm EST

    Hi,

    I face a strange problem quite easy to reproduce:
    The following program creates two forms. One contains a spread with the AllowColumnMove property set to true. In the CellDoubleClick event of this spread, a call to BringToFront is done on the second form.
    If this form hides the first one, then when one activate the first one again, the spread is in a "column moving" state.

    Form2 _form2;
    public Form1()
    {
    InitializeComponent();
    fpSpread1.AllowColumnMove = true;
    this.fpSpread1_Sheet1.Columns.Get(0).Locked = true;
    this.fpSpread1_Sheet1.Columns.Get(1).Locked = true;
    fpSpread1.CellDoubleClick += new FarPoint.Win.Spread.CellClickEventHandler(this.fpSpread1_CellDoubleClick);
    _form2 = new Form2();
    _form2.Show();
    }

    private void fpSpread1_CellDoubleClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
    {
    _form2.BringToFront();
    }


    One more thing: the call to BringToFront does not work even if the correspondin column is locked except if the double click is made in the column header.

    Thanks for your help.

    J-Christophe.
  • Replied 8 September 2017, 3:20 pm EST

    Hello,

    We are able to replicate the issue and hence we are escalating the same to the concerned team for the fix.

    #135149 is tracking id for your issue.

    We will update you once we hear anything from them.

    Thanks,
    Reeva
  • Marked as Answer

    Replied 8 September 2017, 3:20 pm EST

    Hello,

    This is intended behaviour.

    In this case, in order to handle CellDoubleClick event and bring a form to front, mean that form take focus, then the Spread's parent form will lost focus and have no way to handle mouse events any more. Hence, in order to handle this double click event on your own, you need to do is to set CellClickEventArgs.Cancel to true to notify Spread stop processing.

    void fpSpread1_CellDoubleClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
    {
    _form2
    .BringToFront();
    e .Cancel = true; // Cancel event
    }

    Hope it helps.

    Thanks,
    Reeva
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels