PropertyGrid displays sizeable drop down when items count > 14  
Author Message
Seraph_78





PostPosted: Visual C# General, PropertyGrid displays sizeable drop down when items count > 14 Top

I am using a property grid in my application with an enumeration that has about twenty items. When I click on the drop down editor to select a value I get a sizeable drop down box, yet if the enumeration has less than 14 items I get a drop down list that is not sizeable.

Is there anyway to control this

I am using a nullable enumeration and already have a TypeConverter to do a few other bits and pieces but I cant seem to figure out how to do it there.

I dont want to have to create a CustomUITypeEditor that drops down my own listbox populated with the values just so it exhibits consistent behaviour.



Visual C#20  
 
 
Seraph_78





PostPosted: Visual C# General, PropertyGrid displays sizeable drop down when items count > 14 Top

I have done a little bit more digging by calling:

context.GetService(IWindowsFormsEditorService) in the GetStandardValues method of my TypeConverter.

Inspecting the properties of the type returned (PropertyGridInternal.PropertyGridView) i was able to find a RowHeight property that is set to 15 that would explain the behaviour. Unfortunately I can not set that property due to that objects protection level.

So it would seem that I will have to implement a UITypeEditor to achieve what I want.

It would be nice to be able to control the default behaviour somehow because it is a bit naff that I have to create a custom editor now for all lists that have 15 or more items in them just so I dont get a sizeable grip.