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
|
Hello, I would like to left justify the property names (e.g. "Order Number") in the property grid ... currently, all of my property labels are right justified .... Any ideas? Regards, Douglas Birch P.S. Btw, thank you for the nice V2 drop ... really like the new themes! |
|
|
Hello Douglas, In the default theme, the property names should be left-justified already. If you're seeing something different in that situation, we'd need to know a bit more about what you're doing. If you're using one of the new themes, we don't directly provide a way to change visual details such as justification, but we do provide source code so that you can create your own styles based on ours (this is included in all editions, not just Enterprise). You can find this in the Source\Styles directory. To left-justify the property names, take a copy of the theme you're using, locate the DataTemplate for the left-hand column and edit that template to left-justify the text. Here is an example using Alloy.xaml as the base style: * Find the TreeListView that forms the body of the grid. You can do this by searching for an element with the name PART_Grid. In Alloy.xaml, this begins on line 1756. * Look through the TreeListView declaration for the first GridViewColumn. This will be the one that contains the property names. In Alloy.xaml, this is on line 1763. * Look at the CellTemplate for this column. In Alloy.xaml, this is a reference to the FancyNodeTemplate resource. * Find the DataTemplate named by the CellTemplate. (Search for x:Key="FancyNodeTemplate".) In Alloy.xaml, this begins on line 321. * Locate the TextBlock which displays the property name. This will have a binding of Node.HumanName. In Alloy.xaml, it's on line 339. * Change the HorizontalAlignment property from Right to Left. After making this and any other changes, remember you will need to compile this style into your own application or DLL. You should also give the style a new identifier: that is, where the source code says x:Key="{x:Static styles:Alloy.StyleKey}", you should change the key to something of your own. Hope this addresses your issue; if not, let us know. |
|
|
Hi, Im just wondering is there a way to justify all column type to be left aligned, including NumericUpDownEditorKey,CheckBoxEditorKey
Thanks, Justin |
|
|
Hi Justin, Could you clarify what you mean here please -- from looking at the default style and the v2 themed styles, it appears that all of the editors including the two you mention are left-aligned by default. Are you seeing something different? Sorry if I am missing something obvious here...! |
|
|
The thing that im seeing using the Blue Style theme
Style ="{StaticResource {x:Static ms:Blue.StyleKey}}" is all the text(property names) in the first column is right aligned, would like it to be left aligned
Thanks, Justin |
|
|
The only way to do this at the moment is to create your own copy of the style (we provide the source code in the Source > Styles directory), modify the template for the name column and have your project reference the modified style instead of the built-in one. In the case of Blue.xaml, you'll need to look at the FancyNodeTemplate resource. In the current build, that's defined on line 385. Look through this for a TextBlock whose Text is bound to Node.HumanName -- this should be on line 402. You can then change the HorizontalAlignment property from Right to Left. |
|