我试图让UltraGrid通过编辑器属性使用自定义编辑器集。但是它似乎忽略了设置并只使用其内部编辑器。这是我的代码:
public class DialogEditor : UITypeEditor
{
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.Modal;
}
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
MessageBox.Show("Testing 1,2,3");
return base.EditValue(context, provider, value);
}
}
public class TestContainer
{
public TestContainer(int id, string name)
{
Id = id;
Name = name;
}
[Editor(typeof(DialogEditor), typeof(UITypeEditor))]
public int Id { get; set; }
public string Name { get; set; }
public override string ToString()
{
return string.Format("{0} : {1}", Id, Name);
}
}
经过测试:
var data = new List<object>
{
new TestContainer(1, "one"),
new TestContainer(2, "two"),
};
ultraGrid1.DataSource = data;
答案 0 :(得分:1)
答案:你不能。 UITypeEditor仅用于PropertyGrids。 请改用Infragistics Embeddable Editors。