private void sp売上明細データ_CellEditEnding(object sender, SpreadCellEditEndingEventArgs e) { if (e.EditAction == SpreadEditAction.Cancel) { return; } CellName = e.CellPosition.ColumnName; CellText = sp売上明細データ.Cells[e.CellPosition.Row, e.CellPosition.Column].Text; Cell入出金金額 = AppCommon.DecimalParse(sp売上明細データ.Cells[e.CellPosition.Row, "入出金金額"].Text); //スプレッドコンボイベント関連付け解除 if (sp売上明細データ[e.CellPosition].InheritedCellType is GrapeCity.Windows.SpreadGrid.ComboBoxCellType) { GrapeCity.Windows.SpreadGrid.Editors.GcComboBox gccmb = sp売上明細データ.EditElement as GrapeCity.Windows.SpreadGrid.Editors.GcComboBox; if (gccmb != null) { gccmb.SelectionChanged -= comboEdit_SelectionChanged; } } if (sp売上明細データ[e.CellPosition].InheritedCellType is GrapeCity.Windows.SpreadGrid.CheckBoxCellType) { GrapeCity.Windows.SpreadGrid.Editors.CheckBoxEditElement gcchk = sp売上明細データ.EditElement as GrapeCity.Windows.SpreadGrid.Editors.CheckBoxEditElement; if (gcchk != null) { gcchk.Checked -= checkEdit_Checked; gcchk.Unchecked -= checkEdit_Unchecked; } } }
/// <summary> /// SPREAD セルが編集状態になった時の処理 EditElementShowingイベント /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gcSpredGrid_EditElementShowing(object sender, EditElementShowingEventArgs e) { GcSpreadGrid grid = sender as GcSpreadGrid; if (grid.ActiveCell.InheritedCellType is GrapeCity.Windows.SpreadGrid.CheckBoxCellType) { // チェックボックス型セルのイベントを関連付けます。 GrapeCity.Windows.SpreadGrid.Editors.CheckBoxEditElement gcchk = grid.EditElement as GrapeCity.Windows.SpreadGrid.Editors.CheckBoxEditElement; if (gcchk != null) { gcchk.Checked += checkEdit_Checked; gcchk.Unchecked += checkEdit_Unchecked; } } }
/// <summary> /// sp売上明細データ_EditElementShowing /// スプレッドコンボイベント関連付け /// デザイン画面でイベント追加 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void sp売上明細データ_EditElementShowing(object sender, EditElementShowingEventArgs e) { if (e.EditElement is GrapeCity.Windows.SpreadGrid.Editors.GcComboBox) { GrapeCity.Windows.SpreadGrid.Editors.GcComboBox gccmb = e.EditElement as GrapeCity.Windows.SpreadGrid.Editors.GcComboBox; if (gccmb != null) { gccmb.SelectionChanged += comboEdit_SelectionChanged; } } if (e.EditElement is GrapeCity.Windows.SpreadGrid.Editors.CheckBoxEditElement) { GrapeCity.Windows.SpreadGrid.Editors.CheckBoxEditElement gcchk = e.EditElement as GrapeCity.Windows.SpreadGrid.Editors.CheckBoxEditElement; if (gcchk != null) { gcchk.Checked += checkEdit_Checked; gcchk.Unchecked += checkEdit_Unchecked; } } }