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

Blank group headers when restoring settings with the persistence framework and the RadGridView

1 Answer 86 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chris Howle
Top achievements
Rank 1
Chris Howle asked on 04 Jul 2012, 08:34 AM
I'm using the latest version of the Grid View and the PersistenceFramework.  When using the sample code for these two items (from the PersistenceFramework - GridView example) everything appears to work as expected, but this uses a ObjectDataProvider to provide the data.  (I'm following the MVVM pattern) Moving the data collection to an ObservableCollection<Customer> and setting the DataContext to this collection works correctly in the first instance, and grouping works correctly, but when I restart the application, the grouping is applied correctly, but the group header in the Group Panel is present but the text is missing.  Has anyone seen a similar problem, or have a clue why this is happening?

It may be worth noting, that I'm making use of the DisplayAttribute to set the column headings.  Also I have auto add columns turned off and adding the columns explicitly in code.

<telerik:RadGridView x:Name="RadGridView1" CanUserDeleteRows="False"
                      CanUserInsertRows="False"
                      EnableColumnVirtualization="False"
                      AutoExpandGroups="True"
                             AutoGenerateColumns="False"
                      
    RowIndicatorVisibility="Collapsed"
    RowHeight="20"
 
    Persistence:PersistenceManager.StorageId="RepoTradeSecurityListGridView"
                      
         ItemsSource="{Binding}"  VerticalAlignment="Stretch">
    <!--ItemsSource="{Binding Source={StaticResource customers}}"-->
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn                                           
                                    DataMemberBinding="{Binding CustomerID}"
                                    IsFilterable="False"
                                    IsCustomSortingEnabled="False"
                                    IsVisible="True"/>
        <telerik:GridViewDataColumn                                         
                                    DataMemberBinding="{Binding City}"
                                    IsFilterable="False"
                                    IsCustomSortingEnabled="False"
                                    IsVisible="True"/>               
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

1 Answer, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 05 Jul 2012, 08:22 AM
Hello Chris,

The reason for this behavior is that the Headers that are shown within the group panel hold a "Screenshot" of the Column header content by which the group is defined. Since at the moment of the adding of the groups the actual columns have not yet been rendered, the screenshot is not taken correctly resulting in the empty headers. 
A possible workaround for the issue is to apply the grouping on a later stage of the loading of the application. I.e. after the GridView has been rendered, or invoke the group adding with a Dispatcher.  

Hope this helps! 

Kind regards,
Nik
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Chris Howle
Top achievements
Rank 1
Answers by
Nick
Telerik team
Share this question
or