您好,在编辑状态您需要给 CellEditor 直接赋值
- void btnSetValue_Click(object sender, RoutedEventArgs e)
- {
- if (gcSpread.ActiveSheet.ActiveCell != null)
- {
- if(gcSpread.View.CellEditor != null && gcSpread.View.CellEditor is GrapeCity.Windows.SpreadSheet.UI.EditingElement){
- var control = gcSpread.View.CellEditor as GrapeCity.Windows.SpreadSheet.UI.EditingElement;
- control.Text += "Hello";
- }
- else
- {
- gcSpread.ActiveSheet.ActiveCell.Value += "Hello";
- }
- }
-
- }
复制代码 |