Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
695
How to exit edit mode of a cell?
posted

Hi All,

My question: Clicking at area out of the UltraGrid such as windows forms, the white area in the UltraGrid both will not trigger the BeforeExitEditMode event.

Attached is my sample application to demo my issue.

Once you run the sample application, you will see the UltraGrid display with a column named "Counter". 

When I delete\modify one of the cell's data, it will not trigger the BeforeExitEditMode event until I clicked on the UltraGrid's header or other cells.

How can I forced it to trigger the BeforeExitEditMode event when I click at area out of UltraGrid such as windows forms, the white area in the UltraGrid? 

Note: I am using V2009.2

WindowsFormsApplication3.zip
  • 5520
    posted

    try this:

     

    bool exitEditMode = true;

            private void Form1_MouseClick(object sender, MouseEventArgs e)

            {

                ultraGrid1.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ExitEditMode);

            }

     

            private void ultraGrid1_Click(object sender, EventArgs e)

            {

                if (exitEditMode)

                {

                    ultraGrid1.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ExitEditMode);

                }

                    exitEditMode = true;

            }

     

            private void ultraGrid1_ClickCell(object sender, Infragistics.Win.UltraWinGrid.ClickCellEventArgs e)

            {

                exitEditMode = false;

            }