Collections

Grids for WPF Forum

Posted 12 years ago by Robert Harrison
Version: 11.2.0553
Avatar

I have a serial port class, one record for each available serial port on the computer. One of the fields I want to be available to have the user change within the property grid for the selected port is the speed, which could be either 4800 or 9600. This integer value will be saved directly in the underlying database. How do I display the speed field in a combobox on the property grid.

I am evaluating this grid as I have a need to display each field in a specific sequence. Selecting a value can change what is visible/invisible further down in the grid or could also change what values a field further down in the grid can display, ie. the comboxvalues for another field can change based upon a prior selection in a different combobox.

Thanks.

Comments (1)

Answer - Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Robert,

Typically you would associate a TypeConverter with the Speed property. The TypeConverter can then specify a list of standard values, which can optionally be exclusive (which means the user cannot enter freeform values). It is also possible to specify the list of standard values using a custom property editor, but the TypeConverter is generally the best way to go.

You will need to refer to the Custom TypeConverter QuickStart if you are specifying the TypeConverter directly on the Speed property, which I'm assuming is an Int32.

We have several samples that show how to apply custom sorting, including through the use of a SortAttribute applied to the properties. In addition, we have two a Selective Visibility QuickStart that shows how to show/hide certain properties based on the values of other properties.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.