This question is locked. New answers and comments are not allowed.
I am having a problem with the GridView control whereby I am seeing the vertical scrollbar disappear on the creation of a group.
What I am doing is as follows:
1) Data bind a GridView control to a collection of objects
2) Drag a column into the grouping bar (in my example, the Category column)
3) Expanding the first group - the data should expand off the edge of the page, forcing the scrollbar to appear
4) Drag another column into the grouping bar (in my example, the SubCategory column)
5) The vertical scrollbar now disappears - and won't reappear until the top level group is collapsed and re-expanded.
I can also get the same effect when applying a filter to the top level group like so:
1) Data bind a GridView control to a collection of objects
2) Drag a column into the grouping bar (in my example, the Category column)
3) Drag another column into the grouping bar (in my example, the SubCategory column)
4) Expanding the first group - the data should expand off the edge of the page, forcing the scrollbar to appear
5) Select the filter Icon on the first column that is grouped (Category), and select the check box for the group you have expanded
6) The vertical scrollbar now disappears - and won't reappear until the top level group is collapsed and re-expanded.
Below I have attached a very simple code snippet that can be used to reproduce the problem:
XAML:
| <UserControl xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" x:Class="GroupingTest.Page" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > |
| <Grid x:Name="LayoutRoot" Background="White"> |
| <telerikGridView:RadGridView x:Name="dataGrid"></telerikGridView:RadGridView> |
| </Grid> |
| </UserControl> |
Code Behind:
| using System; |
| using System.Collections.Generic; |
| using System.Linq; |
| using System.Windows.Controls; |
| namespace GroupingTest |
| { |
| public class TestRecord1 |
| { |
| public string Category { get; set; } |
| public string SubCategory { get; set; } |
| public decimal Amount { get; set; } |
| } |
| public partial class Page : UserControl |
| { |
| private static string[] Categories = { "C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "C8", "C9" }; |
| private static string[] SubCategories = { |
| "SC0", "SC1", "SC2", "SC3", "SC4", "SC5", "SC6", "SC7", "SC8", "SC9", |
| "SC10", "SC11", "SC12", "SC13", "SC14", "SC15", "SC16", "SC17", "SC18", "SC19", |
| "SC20", "SC21", "SC22", "SC23", "SC24", "SC25", "SC26", "SC27", "SC28", "SC29", |
| "SC30", "SC31", "SC32", "SC33", "SC34", "SC35", "SC36", "SC37", "SC38", "SC39", |
| "SC40", "SC41", "SC42", "SC43", "SC44", "SC45", "SC46", "SC47", "SC48", "SC49", |
| "SC50", "SC51", "SC52", "SC53", "SC54", "SC55", "SC56", "SC57", "SC58", "SC59", |
| "SC60", "SC61", "SC62", "SC63", "SC64", "SC65", "SC66", "SC67", "SC68", "SC69", |
| "SC70", "SC71", "SC72", "SC73", "SC74", "SC75", "SC76", "SC77", "SC78", "SC79", |
| "SC80", "SC81", "SC82", "SC83", "SC84", "SC85", "SC86", "SC87", "SC88", "SC89", |
| "SC90", "SC91", "SC92", "SC93", "SC94", "SC95", "SC96", "SC97", "SC98", "SC99", |
| }; |
| public Page() |
| { |
| InitializeComponent(); |
| this.dataGrid.ItemsSource = GenerateTestData(); |
| } |
| private IEnumerable<TestRecord1> GenerateTestData() |
| { |
| Random r = new Random(); |
| var records = from item in Enumerable.Range(0, 1000) |
| select new TestRecord1 |
| { |
| Category = Categories[r.Next(0, Categories.Count() - 1)], |
| SubCategory = SubCategories[r.Next(0, SubCategories.Count() - 1)], |
| Amount = Convert.ToDecimal(r.NextDouble()) |
| }; |
| return records; |
| } |
| } |
| } |
I am using the Silverlight 2 version of the RadControls toolkit - 2009.2.701.1020
I am not sure if this has already been addressed in another post, though a brief search couldn't find any reference to it - which I find odd, as this is a REALLY simple example, and extremely easy to reproduce.
To me it looks like the grid's scrolling container is not realizing that the content it is managing requires scrolling - and the simple act of expanding and re-expanding wakes it up. Perhaps an event isn't being fired...?
Could you please provide any advice here? Ideally, what I really need right now is a work around - as we are getting very close to our release date and upgrading to the later version in which this may be fixed is really not an option...
Thanks
Nathan
