需要自定义一个控件,在一个单元格里面放两个textbox,中间放一个label,求实现方法。
实现这种效果
现在光标离开后,输入的值显示不出来。想显示这各效果:419.00⊥410.96
- public override Control GetEditorControl(string id, TableCell parent, FarPoint.Web.Spread.Appearance style, FarPoint.Web.Spread.Inset margin, object value, bool upperLevel)
- {
- Table table = new Table();
- table.CellPadding = 0;
- table.CellSpacing = 0;
- table.BorderStyle = BorderStyle.None;
- table.BorderWidth = new Unit(0, UnitType.Pixel);
- table.Width = new Unit(100, UnitType.Percentage);
- TableRow row = new TableRow();
- TableCell cell = new TableCell();
- cell.VerticalAlign = VerticalAlign.Middle;
- cell.HorizontalAlign = HorizontalAlign.Left;
-
- TextBox tb = new TextBox();
- tb.Width = new Unit(40, UnitType.Percentage);
- tb.ID = "txt_1";
- cell.Controls.Add(tb);
- row.Cells.Add(cell);
-
- Label lbl = new Label();
- lbl.Width = new Unit(10, UnitType.Percentage);
- lbl.ID = Guid.NewGuid().ToString("N");
- lbl.Text = "⊥";
- cell.Controls.Add(lbl);
-
- TextBox tb2 = new TextBox();
- tb2.Width = new Unit(40, UnitType.Percentage);
- tb2.ID = "txt_2";
- cell.Controls.Add(tb2);
- row.Cells.Add(cell);
- table.Rows.Add(row);
- return table;
- }
复制代码
是不是还要重写什么方法?求实现 |
|