Home Forums WPF controls Xceed Toolkit Plus for WPF CollectionControl: Customize labels?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • GuglielmoCancelli
    Participant
    Post count: 19
    #44723 |

    Hi,
    I’d like to customize the labels of the CollectionControl, namely:
    – “Select type” and “Properties” labels. Reading the blueprint I believe these values are hard-coded in the template – I would really like to avoid copy-pasting the entire template :/
    – item labels in the drop-down list (on the left of the “add” button)
    – item labels in the listbox (at the moment I’m overriding the ToString() of my FooViewModel, is there any cleaner way, i.e. via some property?)
    – “Search” label in the property grid (I feel I should be able to do it but I can’t find where)

    Happy Easter holidays

    Fawzi [Xceed]
    Member
    Post count: 722

    Hi,

    -“Select type” and “Properties” labels.
    You can modify the hardcoded values in Xceed.Wpf.Toolkit/CollectionControl/Themes/Aero2.normalColor.xaml (for Windows8 an up) or in
    Xceed.Wpf.Toolkit/CollectionControl/Themes/Generic.xaml (for other Windows). case 168490 has been created to have properties to modify those values. The fix will be included in v3.4. With the fix, you will be able to set a style for CollectionControl (in App.xaml) and set these 2 properties values.

    -item labels in the drop-down list
    This is a list of types. Currently, if you set a CollectionControl.NewItemTypes, the new items types will be used. If CollectionControl.NewItemTypes is null, but CollectionControl.ItemsSourceType is defined, the types of the ItemsSource will be used. But when used inside a PropertyGrid, the default CollectionEditor will set its NewItemTypes based on the types from the PropertyItem.PropertyType. I wouldn’t change that, but if you want, you could use your own editor and base it on CollectionEditor in Xceed.Wpf.Toolkit/PropertyGrid/Implementation/Editors/CollectionEditor.cs.

    -item labels in the listbox
    You are using the correct way. Overriding the ToString() method will let you set the object name you want.

    -“Search” label
    You can use the property PropertyGrid.FilterWatermark.

    mlop3s
    Participant
    Post count: 1

    Hi,

    great to hear that we can change the labels, but somehow I’m not sure how to change the item labels in the drop-down list (on the left of the « add » button).
    I have a DepartmentViewModel and the list shows the name of the class, which is not the desired behavior.
    Could you please explain again how to change this? My idea which did not work was to add the following:

    [DisplayName("Department")]
    public class  DepartmentViewModel 

    I expected that the list would then use the Attribute to display in the drop-down – but nope. I still get the DepartmentViewModel.

    Am I missing something?

    Cheers,
    Marco

    Diane [Xceed]
    Moderator
    Post count: 1353

    This is to inform you that the following issue was fixed in the latest version (Toolkit for WPF v3.4):
    “In CollectionControl, the new properties PropertiesLabel and TypeSelectionLabel are now available to customize the layout labels.”

    Download Link: http://forums.xceed.com/latest-xceed-toolkit-plus-for-wpf

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.