找回密码
 立即注册

QQ登录

只需一步,快速开始

xiaozhu

注册会员

8

主题

20

帖子

74

积分

注册会员

积分
74
xiaozhu
注册会员   /  发表于:2017-7-27 09:54  /   查看:3269  /  回复:3
插入表后,表格边框默认是None(即全不显示),需要将其默认显示为All(即全显示)。怎么设置。
另外:
        private void MenuTable_Insert_Table_Click(object sender, RoutedEventArgs e)
        {
            if (_textControl.Tables.Add())
            {
                _fileHandler.DocumentDirty = true;
                var cells = (_textControl.Tables.GetEnumerator().Current as TXTextControl.Table).Cells;
                foreach (TXTextControl.TableCell x in cells)
                {
                    TXTextControl.TableCellFormat myCellFormat = new TXTextControl.TableCellFormat();
                    myCellFormat.LeftBorderWidth = 500;
                    myCellFormat.RightBorderWidth = 50;
                    myCellFormat.TopBorderWidth = 50;
                    myCellFormat.BottomBorderWidth = 50;
                    myCellFormat.VerticalAlignment = TXTextControl.VerticalAlignment.Center;
                    
                    x.CellFormat = myCellFormat;
                    
                }
            }
        }

断点表明程序已经执行,但设置不起作用。

3 个回复

倒序浏览
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-7-27 16:57:28
沙发
按照文档确实是这样设置的。我这边测试过了,这样设置确实没有效果,这个问题我帮你向厂商确认一下看看,可能需要一天的时间。
回复 使用道具 举报
xiaozhu
注册会员   /  发表于:2017-8-16 11:05:48
板凳
还是没有办法吗?我只是想插入表格的时候默认边框有实线而已,难道这都办不到?
回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2017-8-17 10:51:13
地板
xiaozhu 发表于 2017-8-16 11:05
还是没有办法吗?我只是想插入表格的时候默认边框有实线而已,难道这都办不到?

厂商一直没有回复,我是自己又帮你研究了下,找到了原因,应该是枚举器的原因
  1. Table tb = (Table)_textControl.Tables.GetItem(0);
  2.             tb.Cells.GetItem(1, 1).Text="22";
  3.             tb.Cells.GetItem(1, 1).CellFormat = new TableCellFormat() {
  4.                 BackColor=Color.AliceBlue,
  5.                 LeftBorderColor = Color.Red,
  6.                 TopBorderColor = Color.Red,
  7.                 BottomBorderColor = Color.Red,
  8.                 RightBorderColor = Color.Red,

  9.                 LeftBorderWidth = 1,
  10.                 TopBorderWidth = 1,
  11.                 RightBorderWidth = 1,
  12.                 BottomBorderWidth = 1

  13.             };
  14.             tb.Rows.GetItem(3).CellFormat = new TableCellFormat()
  15.             {
  16.                 LeftBorderColor = Color.Black,
  17.                 TopBorderColor = Color.Black,
  18.                 BottomBorderColor = Color.Black,
  19.                 RightBorderColor = Color.Black,

  20.                 LeftBorderWidth = 1,
  21.                 TopBorderWidth = 1,
  22.                 RightBorderWidth = 1,
  23.                 BottomBorderWidth = 1
  24.             };
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部