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

RadGridView items empty during grouping

2 Answers 93 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 26 May 2018, 10:37 AM

 

 

<Window x:Class="TelerikWpfApp1.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        xmlns:controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <controls:RadGridView x:Name="gridView">
        </controls:RadGridView>
    </Grid>
</Window>

I set Items source in .cs via:

this.gridView.ItemsSource = this.DataTable;

 

DataTable is declared like this:

            Columns =
            {
                new DataColumn("Name", typeof(string)),
                new DataColumn("Name2", typeof(string)),
                new DataColumn("Value", typeof(string)),
            }

 

Without grouping, I see 5 items in the GridView.  I'm able to sort, filter, change column order, edit: everything a developer would expect.  However, if I drag a column up to the grouping pane (to group), the entire items panel is empty.  Ungrouping returns the 5 items.  Basically grouping is just seeming to not work at all.  From the Live Visual tree, there are GridViewGroupRows, but they are empty...no content.  Live Property explorer of the GridViewGroupRow shows there are supposed to be items (4) in it.

I'm using 4.7.1 .NET and C:\Program Files (x86)\Progress\Telerik UI for WPF R1 2018\Binaries\WPF45\Telerik.Windows.Controls.GridView.dll (which claims 2018.1.220.45).  

 

 


2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 30 May 2018, 04:43 PM
Hi Chris,

Thanks for the code snippet and images provided.

I tested the behavior of the control locally, but I was not able to replicate this behavior. Can you please test the control on your end with the latest R2 2018 official release? We tried to make some optimizations of the items equality for the R1 2018 SP2 version, but they resulted in some issues so we rolled them back. So, my guess is that the behavior you are experiencing might be related to it. If the control behaves in the same manner with the latest version, can you please try to use the DataTable.DefaultView as a source for RadGridView? Note, that this is the recommended approach when populating RadGridView with a DataTable source collection. This is stated in the Managing Data Overview and in the Configure the Data Bindings topics.

I hope one of these two approaches helps.

Regards,
Stefan
Progress Telerik
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.
0
Chris
Top achievements
Rank 1
answered on 30 May 2018, 07:36 PM

Winner, Winner, chicken dinner.  Upgrading to R2 official has fixed the problem.  Immediately I get grouping, so this was clearly an R1 issue.  Thank you for correcting my error in not catching the DataTable.DefaultView.  It was not necessary for my problem, but clearly is the right thing to do.

 

Thanks again.

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