找回密码
 立即注册

QQ登录

只需一步,快速开始

usst

注册会员

18

主题

48

帖子

134

积分

注册会员

积分
134

活字格认证元老葡萄

usst
注册会员   /  发表于:2016-3-10 12:41  /   查看:3659  /  回复:6
在spread表格区域,右击可以出现复制、粘贴、删除、剪切的功能。
360截图20160310123914004.jpg

6 个回复

倒序浏览
gw0506
超级版主   /  发表于:2016-3-10 18:01:42
沙发
  1. //Markup code
  2. <ContextMenus>
  3.         <FarPoint:ContextMenu Type="Viewport">
  4.           <Items>
  5.             <FarPoint:MenuItem Enabled="True" ImageUrl="http://linktoimagehere/abc.jpc" Text="Menu item 1">
  6.                 <ItemTemplate>
  7.                 <asp:TextBox ID="bac" runat="server" />
  8.                 </ItemTemplate>
  9.             </FarPoint:MenuItem>
  10.             <FarPoint:MenuItem Text="Sort" ImageUrl="http://linktoimagehere/abc.jpc">
  11.                 <ChildItems >                  
  12.                   <FarPoint:MenuItem  Text="Child Item1"  ImageUrl="http://avc/abc.jpc"></FarPoint:MenuItem>
  13.                   <FarPoint:MenuItem Text="Child Item2"></FarPoint:MenuItem>
  14.                 </ChildItems>
  15.             </FarPoint:MenuItem>
  16.             <FarPoint:MenuItem Enabled="True" ImageUrl="http://linktoimagehere/abc.jpc">Menu item 3</FarPoint:MenuItem>
  17.           </Items>
  18.         </FarPoint:ContextMenu>
  19.       </ContextMenus>

  20. protected void Page_Load(object sender, System.EventArgs e)
  21. {
  22. if (this.IsPostBack) return;
  23. FpSpread1.EnableContextMenu = true;
  24. //Create this viewport menu using markup or the ContextMenus property in the property window
  25. FarPoint.Web.Spread.ContextMenu viewportMenu = FpSpread1.ContextMenus[FarPoint.Web.Spread.ContextMenuType.Viewport];
  26. FarPoint.Web.Spread.MenuItem customViewportItem = new FarPoint.Web.Spread.MenuItem("Viewport item 1");
  27. customViewportItem.ChildItems.Add(new FarPoint.Web.Spread.MenuItem("Child item 1"));
  28. customViewportItem.ChildItems.Add(new FarPoint.Web.Spread.MenuItem("Child item 2"));
  29. viewportMenu.Items.Add(customViewportItem);

  30. //This row header menu is created here (no markup or design properties)
  31. FarPoint.Web.Spread.ContextMenu rowHeaderContextMenu = new FarPoint.Web.Spread.ContextMenu();
  32. rowHeaderContextMenu.Type = FarPoint.Web.Spread.ContextMenuType.RowHeader;
  33. FarPoint.Web.Spread.MenuItem rowHeaderItem = new FarPoint.Web.Spread.MenuItem("RowHeader item 1");
  34. rowHeaderItem.ChildItems.Add(new FarPoint.Web.Spread.MenuItem("Child item 1"));
  35. rowHeaderItem.ChildItems.Add(new FarPoint.Web.Spread.MenuItem("Child item 2"));
  36. rowHeaderContextMenu.Items.Add(rowHeaderItem);
  37. FpSpread1.ContextMenus.Add(rowHeaderContextMenu);
  38. }
复制代码
回复 使用道具 举报
zsl2677
注册会员   /  发表于:2016-3-14 15:03:15
板凳
能发个demo吗
回复 使用道具 举报
zsl2677
注册会员   /  发表于:2016-3-14 15:03:18
地板
能发个demo吗
回复 使用道具 举报
gw0506
超级版主   /  发表于:2016-3-15 14:04:53
5#
拿去吧~
ContextMenuTest.rar (7.49 KB, 下载次数: 164)
回复 使用道具 举报
usst
注册会员   /  发表于:2016-3-16 09:35:17
6#

这个不能实现复制粘贴
回复 使用道具 举报
gw0506
超级版主   /  发表于:2016-3-16 11:18:10
7#
之前没理解清楚你的需求。再另一个帖子里有回复,你看下。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部