找回密码
 立即注册

QQ登录

只需一步,快速开始

xzhy80

注册会员

5

主题

27

帖子

56

积分

注册会员

积分
56

活字格认证微信认证勋章

xzhy80
注册会员   /  发表于:2016-7-27 15:01  /   查看:7130  /  回复:14
本帖最后由 xzhy80 于 2016-7-27 15:12 编辑

如题用的是spreadJ8.0
我先定义mytextcelltype类,并继承一个celltype.textcelltype类型,
在继承类里面,目前是什么代码也没写,
将spread的第2列的celltype给设置成mytextcelltype类型

将spread的列标题,设置文字,
执行程序时,列标题会向右窜一列,不知道是什么原因造成的呢



因为内网原因,代码不能附上

大概效果如下图
blob898093566.png

类型定义
public class mytextcelltype
inherits farpoint.win.spread.celltype.textcelltype

end class




14 个回复

正序浏览
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-8-16 11:57:48
15#
应该的,新版本修复问题后我再通知您
回复 使用道具 举报
xzhy80
注册会员   /  发表于:2016-8-16 11:55:19
14#
了解,谢谢解决问题
回复 使用道具 举报
xzhy80
注册会员   /  发表于:2016-8-16 11:55:17
13#
了解,谢谢解决问题
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-8-16 10:06:44
12#
您好,确认是产品BUG,对/t处理有问题。 现有的解决方案是在ClipboardChanged事件中处理

  1.         private void FpSpread2_ClipboardChanged(object sender, EventArgs e)
  2.         {
  3.             IDataObject data = Clipboard.GetDataObject();
  4.             string clipText = string.Empty;
  5.             if (data.GetDataPresent(DataFormats.StringFormat))
  6.                 clipText = (string)data.GetData(DataFormats.StringFormat);
  7.             else if (data.GetDataPresent(DataFormats.UnicodeText))
  8.                 clipText = (string)data.GetData(DataFormats.UnicodeText);
  9.             else if (data.GetDataPresent(DataFormats.OemText))
  10.                 clipText = (string)data.GetData(DataFormats.OemText);
  11.             else if (data.GetDataPresent(DataFormats.Text))
  12.                 clipText = (string)data.GetData(DataFormats.Text);
  13.             if (clipText != string.Empty)
  14.             {
  15.                 string[] rows = clipText.Split(new string[] { "\r\n" }, StringSplitOptions.None);
  16.                 int columnHeaderRowCount = fpSpread1.ActiveSheet.ColumnHeader.RowCount;
  17.                 int rowHeaderColCount = fpSpread1.ActiveSheet.RowHeader.ColumnCount;
  18.                 for (int i = 0; i < columnHeaderRowCount; i++)
  19.                 {
  20.                     rows[i] = rows[i] = rows[i].Substring(rowHeaderColCount, rows[i].Length - rowHeaderColCount);
  21.                 }
  22.                 clipText = string.Join("\r\n", rows);
  23.                 IDataObject correctedData = new DataObject();
  24.                 correctedData.SetData(clipText);
  25.                 Clipboard.SetDataObject(correctedData);
  26.             }
  27.         }
复制代码


(211650)
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-7-29 16:39:32
11#
您好,我在设置了

            inputmap1.Put(new FarPoint.Win.Spread.Keystroke(Keys.C, Keys.Control), FarPoint.Win.Spread.SpreadActions.ClipboardCopyAsString);
重现出了问题.
这里我会提交产品组并寻求解决方案。
回复 使用道具 举报
xzhy80
注册会员   /  发表于:2016-7-29 15:49:53
10#
dexteryao 发表于 2016-7-29 15:46
您的Spread版本是什么?我9.0版本改了也没出现问题,
还有您Ctrl+V粘贴前是先点击左上角后再粘贴的吗

是SPREAD for Windows Forms 8.0J版本的
拷贝前是先点的左上角corner进行全选
然后ctrl+c,
到第二个spread上也先点的corner全选
直接ctrl+v
回复 使用道具 举报
xzhy80
注册会员   /  发表于:2016-7-29 15:47:04
9#
因为我封装了spread后,在画面的designer画面会自动生成InputMap的代码,
fpspread1_InputMapWhenFocusedNormal.Put(New farpoint.win.spread.keystroke(system.windows.forms.keys.v,ctype((system.windows.forms.keys.control or system.windows.forms.keys.none),system.windows.forms.keys)),farpoint.win.spread.spreadactions.clipboardpasteAsString)

并且发现,如果用ClipboardPasteValues来进行拷贝粘贴的话,会讲spread的style也给复制过来,
如果用ClipboardPasteAsString来拷贝粘贴,则会窜列头,不会复制style。
style的复制这个跟帮助上描述的一样,但这个窜列的问题,不知道应该怎样解决。

开始怀疑是因为corner不能赋值,想了挺多办法也不好用
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2016-7-29 15:46:12
8#
您的Spread版本是什么?我9.0版本改了也没出现问题,
还有您Ctrl+V粘贴前是先点击左上角后再粘贴的吗
回复 使用道具 举报
xzhy80
注册会员   /  发表于:2016-7-29 15:28:27
7#
本帖最后由 xzhy80 于 2016-7-29 15:34 编辑

先谢谢及时的回复,我将你的代码给运行了一次,确实没问题,但我把
inputmap1 = fpSpread2.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused);
改成下面代码后,就出现了我说的窜列的问题
inputmap1 = fpSpread2.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused);





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