How to know EditModeOff is triggered by Enter or LeaveCell?

Posted by: thetouristvn on 8 September 2017, 3:09 pm EST

  • Posted 8 September 2017, 3:09 pm EST

    Hi Guys,

    How can i know an EditModeOff event is triggered by Enter key or a LeaveCell event? In my application i just want to do different things whener user press a Enter key or Leave a cell.

    Thanks 

  • Replied 8 September 2017, 3:09 pm EST

    Any help please?

    Thanks 

  • Replied 8 September 2017, 3:09 pm EST

    Hello,

    You can do it this way:- 

          private void Form1_Load(object sender, EventArgs e)
            {
                fpSpread1.EditModeOff += new EventHandler(fpSpread1_EditModeOff);
                fpSpread1.LeaveCell += new FarPoint.Win.Spread.LeaveCellEventHandler(fpSpread1_LeaveCell);
                fpSpread1.DialogKey += new FarPoint.Win.Spread.DialogKeyEventHandler(fpSpread1_DialogKey);
            }

            void fpSpread1_DialogKey(object sender, FarPoint.Win.Spread.DialogKeyEventArgs e)
            {
                if (e.KeyCode == Keys.Enter)
                    listBox1.Items.Add("Enter Key Pressed");// do watever you want to do when enter key pressed here

            }
            void fpSpread1_EditModeOff(object sender, EventArgs e)
            {
                listBox1.Items.Add("EditModeOff");  // do watever you want to do when editmodeoff event is fired

            }
            void fpSpread1_LeaveCell(object sender, FarPoint.Win.Spread.LeaveCellEventArgs e)
            {
                listBox1.Items.Add("LeaveCell");
            }

    Hope it helps.

    Thanks,

    Reeva

  • Replied 8 September 2017, 3:09 pm EST

    Thanks for your replying, Reeva.

    It works when using the DialogKey event. 

  • Replied 8 September 2017, 3:09 pm EST

    Hello,

    Glad to know that your issue has been resolved.

    Thanks,

    Reeva 

Need extra support?

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

Learn More

Forum Channels