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
140
Cell Activating Event Problem
posted

In my Record Updating event i set the IsActive property to true for PaymentMethodCodeDescription field in the XamDataGrid as shown in bold/italic below.

if (e.Record.Cells["PaymentMethodCodeDescription"].Value == null)

{                       MessageBox.Show("Payment Method Code Description cannot be empty");                e.Record.Cells["PaymentMethodCodeDescription"].IsActive = true;

                e.Record.Cells["PaymentMethodCodeDescription"].IsSelected = true;

                StartEditMode();                e.Action = RecordUpdatingAction.CancelUpdateRetainChanges;               // e.Handled = true;                _isValid = false;

                return;

 }

 However, though the IsActive property for PaymentMethodCodeDescription cell is set to true, CellActivating event is fired sometimes and sometimes not.  Please could anyone help me with this? Thanks in advance.

  • 7694
    posted

     Hello,

    When you are using the RecordUpdating event, you are activating the cell before that (cell is already activated), therefore in some cases CellActivating will not be called again. I believe this could be expected in some cases.
    What is the scenario that you are trying to achieve? Maybe moving the code in other events will be a better idea? Or canceling the event in RowUpdating, then setting the cell to edit mode again?

    Thanks.