UITypeEditor Problems
I'm trying to create a UITypeEditor. I really want to be able to create a drop down editor, the problem is that when I set GetEditStyle = UITypeEditorEditStyle.DropDown I don't get any drop down displayed so it never drops down my control.
When I set it to modal and handle the EditValue function that my value doesn't cause the Form Designer to recognize a change has occured with a * beside it to save the changes, and clicking on the edit button again, doesn't have my changes.
I've copied the sample from the help almost exactly and still no go. Here's how I've got it implimented:
On the Collection that the UITypeEditor is used for:
[System.ComponentModel.DesignerSerializationVisibility(DesignerSerializationVisibility.Content), NotifyParentProperty(true), Editor(typeof(ColumnEditor),typeof(System.Drawing.Design.UITypeEditor))] public List<ListColumn> Columns { get { return pColumns; } } |
And Here's my EditValue on the TypeEditor:
publicoverrideobject EditValue(ITypeDescriptorContext context, IServiceProvider provider,object value) { if (context ==null || context.Instance ==null || provider ==null || value.GetType() !=typeof(List IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (edSvc !=null) { frmEditColumns frm =new frmEditColumns(context.Instance, (List if (edSvc.ShowDialog(frm) == DialogResult.OK) { value = frm.GetColumns(); } } return value; } |
What am I doing wrong? First why doesn't the DropDown GetEditStyle cause a down arrow to show and second why doesn't the Modal version actually change the Collection?
Also, I notice that if I custom draw with the PaintValue that the Bounds returned is a very small rectangle on the left of the property's value, not the entire area... I figured it should be the entire area? (I've tured it off and still the drop down doesn't show)
Thanks!

