This is a migrated thread and some comments may be shown as answers.

DataGroup

1 Answer 13 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Archer Admin
Top achievements
Rank 1
Archer Admin asked on 17 May 2016, 02:44 PM

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.

1 Answer, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 20 May 2016, 08:44 AM
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
Tags
ListView
Asked by
Archer Admin
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Share this question
or