Group Header not showed with GroupStyle

2 posts, 0 answers
  1. Dario Concilio
    Dario Concilio avatar
    172 posts
    Member since:
    Apr 2016

    Posted 27 Jan Link to this post

    Hi to all,

    I configured a Listbox with single Group, but if I change a GroupStyle, Group item not longer appears.

    my XAML/C# code is this, and I attached a screenshots (where I put a red rectangle, it not shows my value), where I wrong?

    01.FastSearchItems = new ObservableCollection<FastSearchItem>();
    02.var view = new CollectionViewSource();
    03.view.GroupDescriptions.Add(new PropertyGroupDescription(propertyName: "Tipo"));
    04.view.Source = FastSearchItems;
    05.FastSearchItemsFound = view;
    06. 
    07.//Add several items
    08.FastSearchItems.Add(new FastSearchItem(/*parameter values*/));
    09.//[..]
    01.<telerik:RadListBox x:Name="FastSearchRadListBox" ItemsSource="{Binding FastSearchItemsFound.View}"
    02.                    Grid.Row="2" Width="300" Grid.Column="2"
    03.                    MouseDoubleClick="FastSearchRadListBox_MouseDoubleClick"
    04.                    VerticalAlignment="Top"
    05.                    Height="400" Visibility="{Binding FastSearchIsDropDownOpen,Converter={StaticResource VisibilityConverter}}"
    06.                    ScrollViewer.VerticalScrollBarVisibility="Auto"
    07.                    ScrollViewer.HorizontalScrollBarVisibility="Disabled">
    08.    <telerik:RadListBox.ItemsPanel>
    09.        <ItemsPanelTemplate>
    10.            <StackPanel Orientation="Vertical" />
    11.        </ItemsPanelTemplate>
    12.    </telerik:RadListBox.ItemsPanel>
    13.    <telerik:RadListBox.ItemTemplate>
    14.        <DataTemplate>
    15.            <StackPanel>
    16.                <TextBlock Text="{Binding Caption}" />
    17.            </StackPanel>
    18.        </DataTemplate>
    19.    </telerik:RadListBox.ItemTemplate>
    20.    <telerik:RadListBox.GroupStyle>
    21.        <GroupStyle>
    22.            <GroupStyle.HeaderTemplate>
    23.                <DataTemplate>
    24.                    <StackPanel Orientation="Vertical" Background="#FAFAFA">
    25.                        <TextBlock Text="{Binding Caption}" FontWeight="Bold"/>
    26.                    </StackPanel>
    27.                </DataTemplate>
    28.            </GroupStyle.HeaderTemplate>
    29.        </GroupStyle>
    30.    </telerik:RadListBox.GroupStyle>
    31.</telerik:RadListBox>
  2. Yana
    Admin
    Yana avatar
    4602 posts

    Posted 01 Feb Link to this post

    Hello Dario,

    I have tested the provided code, but everything works as expected at our side - the group header is shown with Xaml and NoXaml assemblies. Could you try to create a sample app demonstrating the erroneous behavior and send it to us? You should open a support ticket and attache it there.

    Regards,
    Yana
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top