Windows Develop Bookmark and Share   
 index > Windows Forms General > Add NumericUpDown to PropertyGrid
 

Add NumericUpDown to PropertyGrid

Hi, i havea question about designer's property grid. i have inherited control that has some properties.

this properties by default appears in the Property grid of the designer.

Now, one of this properties take value only between 0 and 1 .

How i can show this property in PropertyGrid as NumericUpDown or as enumeration of numbers ?.

Pr.Wael  Wednesday, June 18, 2008 3:06 AM
Hi,

You can't have an updown inplace control in the Microsoft PropertyGrid. But you can have a dropdown list with your values 0 and 1. Just derive a TypeConverter from Int32Converter and override GetStandardValuesSupported (to return true) and GetStandardValues (to return an array with 0 and 1). Then attach the converter to your property.

Best regards,


Nicolas Cadilhac @ VisualHint
Smart PropertyGrid.Net
Microsoft PropertyGrid Resource List
Free PropertyGrid for MFC
Smart FieldPackEditor.Net / DateTimePicker

VisualHint  Wednesday, June 18, 2008 12:05 PM
Hi,

You can't have an updown inplace control in the Microsoft PropertyGrid. But you can have a dropdown list with your values 0 and 1. Just derive a TypeConverter from Int32Converter and override GetStandardValuesSupported (to return true) and GetStandardValues (to return an array with 0 and 1). Then attach the converter to your property.

Best regards,


Nicolas Cadilhac @ VisualHint
Smart PropertyGrid.Net
Microsoft PropertyGrid Resource List
Free PropertyGrid for MFC
Smart FieldPackEditor.Net / DateTimePicker

VisualHint  Wednesday, June 18, 2008 12:05 PM

Hi Sir. Thank you very much for your help .

But i don't understand some things in your explaniation, like attaching converter to my property . So may you send me small sample that implement your method please ?

Pr.Wael  Sunday, June 22, 2008 8:11 AM

You can use google to search for other answers

Custom Search

More Threads

• Naming UI Controls
• Really confused about ToolStrip color (BackColor?)
• Creating icons in a ListBox type control
• vertical menu strip
• Problems getting printer status
• UserControl Custom Events
• Image Stretch -- No Gradient
• labeled border in form
• Enabling and Disabling DataGridView CheckBox Column
• Retaining png transparency problem