PageConfigurationUIDataGridConfiguration_CellEditEnding Method |
Namespace: SOWIWin.Helper
protected virtual void DataGridConfiguration_CellEditEnding( Object sender, DataGridCellEditEndingEventArgs e )
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); } }