DataGroup

2 posts, 0 answers
  1. Archer Admin
    Archer Admin avatar
    5 posts
    Member since:
    May 2006

    Posted 17 May Link to this post

    How do I use a DelegateGroupDescriptor to group by a certain key (a GUID in my case) but show a user friendly value in the group header on the screen (i.e. Recent Content)?

     

    Also, the scrolling seems to get messed up when you have a several hundred items and select an item at the bottom of the screen, the scroll bars jump around and the item you selected goes out of view.

  2. Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 20 May Link to this post

    Hello Archer,

    In order to customize the appearance of the group header you can take advantage of GroupHeaderTemplate:
      <utility:GroupHeaderConverter x:Key="converter"/>
     
    ....
     
                <library1:TXGridView.GroupHeaderTemplate>
     
                    <DataTemplate>
     
                        <TextBlock Text="{Binding Converter={StaticResource converter}}"/>
     
                    </DataTemplate>
     
                </library1:TXGridView.GroupHeaderTemplate>

    The Column header receives GroupHeaderContext as parameter which contains info for group, its key, level and  children items. So binding with value converter will enable you to access this data. Here is s sample implementation for a Value converter that  access the children items:
    public class GroupHeaderConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
     
        {
            var ghc = value as GroupHeaderContext;
       
     
            return (ghc.Group.ChildItems[0] as TestMedia).GroupName;
        }
     
     
        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }



    Regarding the second issue I can confirm that there an issue with the listview in the described scenario. 

    The behavior we observe is the inconsistent scrolling during first scroll down. It occurs until all element have been measured at least once.

    I have logged this in our feedback portal where you can track its progress - http://feedback.telerik.com/Project/167/Feedback/Details/192163-listview-scrollbar-position-and-size-are-inconsistent-in-wrap-layout

    We will do our best to fix it in our next iteration. It can be expected to be included in the build scheduled for the beginning of June.

    Please excuse us for the inconvenience caused.
     


    Regards,
    Tsvyatko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top