后台程序给单元个设置的格式 和内容 界面中CTRL+Z撤销不了怎么解决?
程序中我是这样给单元格设置的:
Cell ce = m_ReportCtrl.SpreadSheet.gcSpreadSheet1.View.ActiveSheet.Cells[cur_row, cur_col];
//判断粘贴模式
if (pastModel == "Formulas") //公式
{
ce.Formula = ConvertFormula(cur_row, cur_col, _dictionary_cellvalues.Value); ;
}
else if (pastModel == "Formatting")//格式
{
ce.ColumnSpan = _dictionary_cellvalues.Value.ColumnSpan;
ce.RowSpan = _dictionary_cellvalues.Value.RowSpan;
ce.BorderBottom = _dictionary_cellvalues.Value.BorderBottom;
ce.BorderLeft = _dictionary_cellvalues.Value.BorderLeft;
ce.BorderRight = _dictionary_cellvalues.Value.BorderRight;
ce.BorderTop = _dictionary_cellvalues.Value.BorderTop;
ce.FontFamily = _dictionary_cellvalues.Value.FontFamily;
ce.FontSize = _dictionary_cellvalues.Value.FontSize;
ce.FontStyle = _dictionary_cellvalues.Value.FontStyle;
ce.Foreground = _dictionary_cellvalues.Value.Foreground;
ce.Background = _dictionary_cellvalues.Value.Background;
ce.FontWeight = _dictionary_cellvalues.Value.FontWeight;
ce.Formatter = _dictionary_cellvalues.Value.Formatter;
ce.FontStretch = _dictionary_cellvalues.Value.FontStretch;
ce.VerticalAlignment = _dictionary_cellvalues.Value.VerticalAlignment;
ce.HorizontalAlignment = _dictionary_cellvalues.Value.HorizontalAlignment;
ce.Underline = _dictionary_cellvalues.Value.Underline;
ce.WordWrap = _dictionary_cellvalues.Value.WordWrap;
ce.Tag = _dictionary_cellvalues.Value.Tag;
}
else //全部
{
ce.Text = _dictionary_cellvalues.Value.Text;
ce.ColumnSpan = _dictionary_cellvalues.Value.ColumnSpan;
ce.RowSpan = _dictionary_cellvalues.Value.RowSpan;
ce.BorderBottom = _dictionary_cellvalues.Value.BorderBottom;
ce.BorderLeft = _dictionary_cellvalues.Value.BorderLeft;
ce.BorderRight = _dictionary_cellvalues.Value.BorderRight;
ce.BorderTop = _dictionary_cellvalues.Value.BorderTop;
ce.FontFamily = _dictionary_cellvalues.Value.FontFamily;
ce.FontSize = _dictionary_cellvalues.Value.FontSize;
ce.FontStyle = _dictionary_cellvalues.Value.FontStyle;
ce.Foreground = _dictionary_cellvalues.Value.Foreground;
ce.Background = _dictionary_cellvalues.Value.Background;
ce.FontStretch = _dictionary_cellvalues.Value.FontStretch;
ce.FontWeight = _dictionary_cellvalues.Value.FontWeight;
ce.Value = _dictionary_cellvalues.Value.Value;
ce.HorizontalAlignment = _dictionary_cellvalues.Value.HorizontalAlignment;
ce.VerticalAlignment = _dictionary_cellvalues.Value.VerticalAlignment;
ce.Underline = _dictionary_cellvalues.Value.Underline;
ce.Formula = ConvertFormula(cur_row, cur_col, _dictionary_cellvalues.Value);
ce.WordWrap = _dictionary_cellvalues.Value.WordWrap;
ce.Formatter = _dictionary_cellvalues.Value.Formatter;
ce.Tag = _dictionary_cellvalues.Value.Tag;
}
|
|