Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Commented Unassigned: How to use multiple columns in PropertyGrid? [22102]

$
0
0
Hello,

does anyone have experiences with using multiple columns in the PropertyGrid?

A.

```
Property foo | foo.a | foo.b | foo.c |
```
```
Property baa | baa.a | baa.b | baa.c |
```

B.
```
Property foo foo.a
foo.b
foo.c
```
```
Property baa baa.a
baa.b
baa.c
```


I would like to have A. instead of B. for my properties (foo, baa) which are represented by a list of values.

There does not seem to be support for multiple columns by default. (Also see this old related question:
https://social.msdn.microsoft.com/Forums/windows/en-US/f3ecca87-6c7e-4216-8324-c0e4975d3233/cant-propertygrid-support-multi-column?forum=winforms)

I think about synchronizing several custom PropertyGrid editors with events. Lets say
each editor has three elements in a row. If I change the width of the first element (foo.a), all other
editors should change the width of their first element (baa.a) as well. This way, the PropertyGrid editors
would behave like the sub cells are organized in multiple columns.

Is this a good idea? Or would you expect the event mechanism to bee too slow or cause
other issues? Any other suggestions?

Best regards.
Comments: ** Comment from web user: BoucherS **

Hi,

The PropertyGrid doesn't support multiple columns. Each line is made of the PropertyName and the PropertyValue. The apporpriate editor will be use to edit the PropertyValue.

If your properties (foo, baa) are collections, the PropertyGrid will use the CollectionControl as the editor for each of them. The CollectionControl is a popup window letting you chose individual items of the collection to edit its properties. You can try the demo available here : http://xceed.com/WPF_Toolkit_Demo.html, look for sample Data/PropertyGrid/Editors/DefaultEditors.

If you want multiple columns, you could use a DataGrid to display the data :

col1 | col2 | col3 | col4
Property foo | foo.a | foo.b | foo.c
Property baa | baa.a | baa.b | baa.c

editors would be appropriate by columns.


Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>