找回密码
 立即注册

QQ登录

只需一步,快速开始

byf

注册会员

11

主题

43

帖子

130

积分

注册会员

积分
130
byf
注册会员   /  发表于:2017-6-7 10:12  /   查看:2931  /  回复:4
后台程序给单元个设置的格式 和内容  界面中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;

                                }   

4 个回复

倒序浏览
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-6-7 17:14:40
沙发
这个问题之前有讨论过,如果代码也需要undo,需要试用undoAction
http://blog.gcpowertools.com.cn/ ... ad_cellContent.aspx
回复 使用道具 举报
byf
注册会员   /  发表于:2017-6-7 17:55:38
板凳
dexteryao 发表于 2017-6-7 17:14
这个问题之前有讨论过,如果代码也需要undo,需要试用undoAction
http://blog.gcpowertools.com.cn/post/ ...

这个我看了,但是这些代码和我项目中的代码引用的都不一样。
using GrapeCity.CalcEngine;
using GrapeCity.Windows.SpreadSheet.UI;
using GrapeCity.Windows.SpreadSheet.Data;
葡萄城的我就引用了这些。
回复 使用道具 举报
byf
注册会员   /  发表于:2017-6-7 17:55:48
地板
dexteryao 发表于 2017-6-7 17:14
这个问题之前有讨论过,如果代码也需要undo,需要试用undoAction
http://blog.gcpowertools.com.cn/post/ ...

这个我看了,但是这些代码和我项目中的代码引用的都不一样。
using GrapeCity.CalcEngine;
using GrapeCity.Windows.SpreadSheet.UI;
using GrapeCity.Windows.SpreadSheet.Data;
葡萄城的我就引用了这些。
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-6-8 09:28:19
5#
估计您用的很老的版本吧,建议您去官网下载最新版本测试。

回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部