R
Romain TAILLANDIER
Hi group
I have a simple property, of type string that can take only a few
defined value (as an enum).
The containing class can be viewed in a property grid, and i want the
user can select between the predefined values, exactly as it was an
enum.
I have created a specific UITypeEditor, the GetEditStyle method returns
a UITypeEditorEditStyle.DropDown, the EditValue create a ListBox
containing the predefined values. After the ListBox selected value
changed, the EditValue method returns the selected value of the list
box.
All work fine !
But if i don't click on the dropdown buton, i can edit the property
grid as if it was a string, and affect a not predefined value. How can
i prevent the property grid to be editable (of course i need the Set
accessor for this property) ?
How can i prevent the user to manually write a bad string ?
Thank
ROM
I have a simple property, of type string that can take only a few
defined value (as an enum).
The containing class can be viewed in a property grid, and i want the
user can select between the predefined values, exactly as it was an
enum.
I have created a specific UITypeEditor, the GetEditStyle method returns
a UITypeEditorEditStyle.DropDown, the EditValue create a ListBox
containing the predefined values. After the ListBox selected value
changed, the EditValue method returns the selected value of the list
box.
All work fine !
But if i don't click on the dropdown buton, i can edit the property
grid as if it was a string, and affect a not predefined value. How can
i prevent the property grid to be editable (of course i need the Set
accessor for this property) ?
How can i prevent the user to manually write a bad string ?
Thank
ROM