This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
We have a few properties with rather long names. Because the default behavior of the PropertyGrid is to fit the 'name' (description) column to the text contained within, our controls (in the right hand column) get rather squished. What is the best way to force a max width for the name column, and subsequently cause longer names to word wrap onto the next line? |
|
|
You could do this by setting the PropertyNameTemplate on your PropertyGrid to something like the following:
Depending on the effect you're looking for you could also set a MinWidth, or disable the column resizing by adding
to the PropertyGrid as the name column can also become squished in the case it's enabled. |
|
|
Setting the PropertyNameTemplate was what I had tried first, to no avail. I've attached an example project wherein the PropertyNameTemplate should be making red colored text, with character ellipsis on with a maxwidth of 50, but this change is not reflected in the propertygrid. What am I missing? Also worth noting that I am using the Nightly from 1/3/2013, if that matters. |
|
|
Thanks for the concise repro. You weren't missing anything, this was indeed a bug that happened to occur when using one of the built-in themes. This has been fixed and will be available in the next nightly. Incidentally, if you wanted to get it working immediately so you can work on your custom template, you can remove the reference to OfficeBlack in the resource dictionary (the PropertyNameTemplate is applied correctly with the generic theme). As a side note, you might have seen in the xmldoc comment for that property that the template is responsible for including expand/collapse visuals. I notice you've got a source license - if you're going to be using the collection editor (or anything else that needs it), you can base your template off the FancyNodeTemplate in OfficeBlack.PropertyGrid.xaml (line 435). |
|
|
The nightly fixed the issue, thanks! |
|