Wrong GroupHeaderTemplate

6 posts, 1 answers
  1. Thomas
    Thomas avatar
    4 posts
    Member since:
    Nov 2014

    Posted 16 Dec 2014 Link to this post

    Seems that GroupHeaderTemplate doesn't use the Converter set in the GroupDescription?
    How can I make a template that does?
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 18 Dec 2014 Link to this post

    Hello,

    May I ask you to share a bit more information on what the final goal you would like to achieve is? How have you currently defined the converter and what result do you expect?

    Regards,
    Dimitrina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Thomas
    Thomas avatar
    4 posts
    Member since:
    Nov 2014

    Posted 18 Dec 2014 in reply to Dimitrina Link to this post

    I have a dataset where I wan't to group by a column that consists of numbers, but I want to show there real value with the help of a converter.

    My code is like this:
    CollectionView view = CollectionViewSource.GetDefaultView(myGridView.ItemsSource) as CollectionView;
    view.GroupDescriptions.Add(new PropertyGroupDescription("EscalationState", new Converters.EnumeratorConverter("EscalationState")));
    myGridView.ItemsSource = view;

    My "EnumeratorConverter" converts the numbers to texts (ie "1" is converter to "Escalated").

    Problem is that it seems that the default GroupHeaderTemplate just shows the numbers regardless of the result from my converter.
    (It shows "1" instead of "Escalated")
  4. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 18 Dec 2014 Link to this post

    Hi,

    You can check the "Group By Formatted Value" WPF Demo on how the converter should be respected. 
    If this does not work for you, I can suggest you to check the Modify the Group Row article on how to configure your own custom GroupHeaderTemplate.

    Regards,
    Dimitrina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Thomas
    Thomas avatar
    4 posts
    Member since:
    Nov 2014

    Posted 19 Dec 2014 in reply to Dimitrina Link to this post

    Unfortunatly Group.Key in the "Modify the Group Row" does'nt work for me, as it doesn't use the converter from the PropertyGroupDescriptor.
    I've managed to use the solution in "Group By Formatted Value". Allthough it wasn't what I wanted (cause my custom control uses the unconverter value).

    Anyway, thanks for your help.
    I think you should consider implimenting support for PropertyGroupDescriptor Converter in the default GroupHeader.

    Best regards,
    Thomas
  6. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 19 Dec 2014 Link to this post

    Hello Thomas,

    Thank you for sharing your feedback.

    Additionally, you can help us making UI for WPF even better submitting your feedback and ideas, request a new feature or simply "like" and follow your favorite items on the XAML Feedback Portal: Feedback Portal.

    Regards,
    Dimitrina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top