Click or drag to resize

PageConfigurationUIDataGridConfiguration_CellEditEnding Method

Event end of edit: triggers of event DataGridCellEditEnding or override this.

Namespace:  SOWIWin.Helper
Assembly:  SOWIWin.Helper (in SOWIWin.Helper.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
protected virtual void DataGridConfiguration_CellEditEnding(
	Object sender,
	DataGridCellEditEndingEventArgs e
)

Parameters

sender
Type: SystemObject
This object to pass on event DataGridCellEditEnding
e
Type: System.Windows.ControlsDataGridCellEditEndingEventArgs
This object to pass on event DataGridCellEditEnding
Examples
This example override this and updated data

       /// <summary>
       /// Event end of edit: updated data
       /// </summary>
       /// <param name="sender"></param>
       /// <param name="e"></param>
       protected override void DataGridConfiguration_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
       {
           try
           {
               DataItemClass lItem = (DataItemClass)e.Row.Item;
               lItem = this.Configuration.GetByName(ItemName);
               object lValue = default(object);
               switch (e.EditingElement.GetType().ToString())
               {
                   case "System.Windows.Controls.TextBox":
                       var lTextBox = (System.Windows.Controls.TextBox)e.EditingElement;
                       lValue = lTextBox.Text.ToString();
                       break;

                   case "System.Windows.Controls.CheckBox":
                       var lCheckBox = (System.Windows.Controls.CheckBox)e.EditingElement;
                       lValue = lCheckBox.IsChecked;
                       break;

                   default:
                       break;
               }

               var lItemIXML = (SIC.Setting.ISettingXML)lItem;
               lItemIXML[e.Column.Header.ToString()] = lValue;

               this.Configuration.Update(lItem, ItemName);
               if (e.Column.Header.ToString() == "Name")
               {
                   ItemName = lItemIXML.Name;
               }
           }
           catch (Exception ex)
           {
               SOWIWin.Helper.Message.Show(ref ex);
           }
       }
See Also