本文整理汇总了C#中Column.GenerateUIMetadata方法的典型用法代码示例。如果您正苦于以下问题:C# Column.GenerateUIMetadata方法的具体用法?C# Column.GenerateUIMetadata怎么用?C# Column.GenerateUIMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Column
的用法示例。
在下文中一共展示了Column.GenerateUIMetadata方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getControl
private Control getControl(Column column)
{
Control c = null;
switch (column.GenerateUIMetadata().EditorType)
{
case EditorTypes.Undefined:
case EditorTypes.Hidden:
break;
case EditorTypes.TextEdit:
c = new TextBox();
break;
case EditorTypes.MemoEdit:
case EditorTypes.HTMLEdit:
c = new TextBox() { Multiline = true };
c.Height = 50;
break;
case EditorTypes.CheckBox:
c = new CheckBox();
break;
case EditorTypes.ComboBox:
c = new ComboBox();
(c as ComboBox).Items.Add("One");
(c as ComboBox).Items.Add("Two");
(c as ComboBox).Items.Add("Three");
break;
case EditorTypes.LookUp:
c = new TextBox();
c.Text = "LookUp";
break;
case EditorTypes.DateEdit:
c = new DateTimePicker();
break;
case EditorTypes.NumberEdit:
c = new NumericUpDown();
break;
case EditorTypes.TimeEdit:
c = new TextBox();
c.Text = "TimeEdit";
break;
case EditorTypes.TagEdit:
c = new TextBox();
c.Text = "TagEdit";
break;
default:
break;
}
if (c == null) return null;
Panel p = new Panel() { Width = 400, Height = c.Height+4};
Label l = new Label() { Width=160, TextAlign = ContentAlignment.MiddleRight, Text = column.GenerateUIMetadata().DisplayName};
c.Width = 240;
c.Left = 160;
p.Tag = c.Tag = column;
p.Controls.Add(l);
p.Controls.Add(c);
p.MouseDown += p_Click;
l.MouseDown += p_Click;
c.MouseDown += p_Click;
return p;
}