找回密码
 立即注册

QQ登录

只需一步,快速开始

Sunghalee

初级会员

8

主题

11

帖子

212

积分

初级会员

积分
212
Sunghalee
初级会员   /  发表于:2019-11-21 17:16  /   查看:3280  /  回复:1
1金币
  objMaskEditor.Format = New GrapeCity.Win.ElTabelle.Editors.MaskFormat("\D{4}-\D{1}", " ", " ")



ElTabelle  换成 MultiRow  ,MaskFormat用什么可以替代?

1 个回复

倒序浏览
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2019-11-21 18:26:00
沙发
可以参考下面的代码

  1. private void InitializeComponent()
  2.         {
  3.             GrapeCity.Win.MultiRow.InputMan.MaskPatternField maskPatternField1 = new GrapeCity.Win.MultiRow.InputMan.MaskPatternField();
  4.             GrapeCity.Win.MultiRow.InputMan.MaskLiteralField maskLiteralField1 = new GrapeCity.Win.MultiRow.InputMan.MaskLiteralField();
  5.             GrapeCity.Win.MultiRow.InputMan.MaskPatternField maskPatternField2 = new GrapeCity.Win.MultiRow.InputMan.MaskPatternField();
  6.             GrapeCity.Win.MultiRow.InputMan.MaskLiteralField maskLiteralField2 = new GrapeCity.Win.MultiRow.InputMan.MaskLiteralField();
  7.             GrapeCity.Win.MultiRow.InputMan.MaskPatternField maskPatternField3 = new GrapeCity.Win.MultiRow.InputMan.MaskPatternField();
  8.             this.columnHeaderSection1 = new GrapeCity.Win.MultiRow.ColumnHeaderSection();
  9.             this.checkBoxCell1 = new GrapeCity.Win.MultiRow.CheckBoxCell();
  10.             this.gcMaskCell1 = new GrapeCity.Win.MultiRow.InputMan.GcMaskCell(false);
  11.             //
  12.             // Row
  13.             //
  14.             this.Row.Cells.Add(this.checkBoxCell1);
  15.             this.Row.Cells.Add(this.gcMaskCell1);
  16.             this.Row.Height = 81;
  17.             this.Row.Width = 620;
  18.             //
  19.             // columnHeaderSection1
  20.             //
  21.             this.columnHeaderSection1.Height = 40;
  22.             this.columnHeaderSection1.Name = "columnHeaderSection1";
  23.             this.columnHeaderSection1.Width = 620;
  24.             //
  25.             // checkBoxCell1
  26.             //
  27.             this.checkBoxCell1.DataField = "sex";
  28.             this.checkBoxCell1.Location = new System.Drawing.Point(179, 42);
  29.             this.checkBoxCell1.Name = "checkBoxCell1";
  30.             this.checkBoxCell1.TabIndex = 0;
  31.             //
  32.             // gcMaskCell1
  33.             //
  34.             maskPatternField1.MaxLength = 3;
  35.             maskPatternField1.MinLength = 3;
  36.             maskPatternField1.Pattern = "\\D";
  37.             maskLiteralField1.Text = "-";
  38.             maskPatternField2.MaxLength = 3;
  39.             maskPatternField2.MinLength = 3;
  40.             maskPatternField2.Pattern = "\\D";
  41.             maskLiteralField2.Text = "-";
  42.             maskPatternField3.MaxLength = 4;
  43.             maskPatternField3.MinLength = 4;
  44.             maskPatternField3.Pattern = "\\D";
  45.             this.gcMaskCell1.Fields.Add(maskPatternField1);
  46.             this.gcMaskCell1.Fields.Add(maskLiteralField1);
  47.             this.gcMaskCell1.Fields.Add(maskPatternField2);
  48.             this.gcMaskCell1.Fields.Add(maskLiteralField2);
  49.             this.gcMaskCell1.Fields.Add(maskPatternField3);
  50.             this.gcMaskCell1.Location = new System.Drawing.Point(295, 42);
  51.             this.gcMaskCell1.Name = "gcMaskCell1";
  52.             this.gcMaskCell1.ShortcutKeys.AddRange(new GrapeCity.Win.MultiRow.InputMan.ShortcutDictionaryEntry[] {
  53.             new GrapeCity.Win.MultiRow.InputMan.ShortcutDictionaryEntry(System.Windows.Forms.Keys.F2, "ShortcutClear"),
  54.             new GrapeCity.Win.MultiRow.InputMan.ShortcutDictionaryEntry(((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Return))), "ApplyRecommendedValue")});
  55.             this.gcMaskCell1.TabIndex = 1;
  56.             //
  57.             // Template1
  58.             //
  59.             this.ColumnHeaders.AddRange(new GrapeCity.Win.MultiRow.ColumnHeaderSection[] {
  60.             this.columnHeaderSection1});
  61.             this.Height = 121;
  62.             this.Width = 620;



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