RadGridView - Bug when collapsing bottommost groups.

4 posts, 0 answers
  1. Rob
    Rob avatar
    238 posts
    Member since:
    Jan 2009

    Posted 02 Dec 2011 Link to this post

    Hello,

    Below you will see a simple demo project illustrating my case.  I am also able to get almost similar behavior using the demo site.

    1) Load a RadGridView with around 100 rows of data. (Not sure at what point this becomes an issue, but we noticed it here).
    2) Group by one of the columns so you get some nicely spaced groupings.  I had 5 groups of 20 records each.
    3) Scroll to the bottom of the RadGridView.
    4) Collapse the bottom most group.

    You should see some large white spaces in the grid, if there is any data left at all.  On the demo site, it seems like sometimes the data will eventually show up.  Sometimes not.

    I am using the latest dll's - q3 build 1129.

    <UserControl    x:Class="SilverlightApplication85.MainPage"
    >
      <Grid x:Name="LayoutRoot" Background="White">
        <telerik:RadGridView ItemsSource="{Binding}" AutoGenerateColumns="False" AutoExpandGroups="True">
          <telerik:RadGridView.GroupDescriptors>
            <telerik:GroupDescriptor Member="property2" />
          </telerik:RadGridView.GroupDescriptors>
          <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn Header="p1" DataMemberBinding="{Binding property1, Mode=TwoWay}" />
            <telerik:GridViewDataColumn Header="p2" DataMemberBinding="{Binding property2, Mode=TwoWay}" />
            <telerik:GridViewDataColumn Header="p3" DataMemberBinding="{Binding property3, Mode=TwoWay}" />
            <telerik:GridViewDataColumn Header="p4" DataMemberBinding="{Binding property4, Mode=TwoWay}" />
          </telerik:RadGridView.Columns>
        </telerik:RadGridView>
      </Grid>
    </UserControl>
    using System;
    using System.Collections.ObjectModel;
    using System.Windows;
    using System.Windows.Controls;
     
    namespace SilverlightApplication85
    {
      public partial class MainPage : UserControl
      {
        public MainPage()
        {
          InitializeComponent();
          this.Loaded += new RoutedEventHandler(MainPage_Loaded);
        }
     
        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
          ObservableCollection<MyDataObject> list = new ObservableCollection<MyDataObject>();
          for (int i = 1; i <= 100; i++)
          {
            MyDataObject mdo = new MyDataObject()
            {
              property1 = Guid.NewGuid().ToString(),
              property2 = (i % 5).ToString(),
              property3 = (i % 10).ToString(),
              property4 = (i % 20).ToString()
            };
            list.Add(mdo);
          }
     
          this.DataContext = list;
        }
      }
     
      public class MyDataObject
      {
        public string property1 { get; set; }
        public string property2 { get; set; }
        public string property3 { get; set; }
        public string property4 { get; set; }
      }
    }
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 05 Dec 2011 Link to this post

    Hello Rob,

     Indeed you are right. I have reproduced this issue on my end.
    Actually such a problem was already logged into our system for fixing. You could follow its progress here.

    Kind regards,
    Didie
    the Telerik team

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

  3. Rob
    Rob avatar
    238 posts
    Member since:
    Jan 2009

    Posted 21 Dec 2011 Link to this post

    Do you happen to know of a workaround I can apply until the fix is available?  An UpdateLayout() or Rebind() maybe?
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 22 Dec 2011 Link to this post

    Hello,

    As a workaround you could call the InvalidateMeasure() method on GroupRowIsExpandedChaned event:

    private void dataGrid_GroupRowIsExpandedChanged(object sender, Telerik.Windows.Controls.GridView.GroupRowEventArgs e)
    {
            dataGrid.InvalidateMeasure();
    }

    Does this help?

    Regards,
    Didie
    the Telerik team

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

Back to Top