Slow performance on Custom GridViewDataColumn

5 posts, 0 answers
  1. Paulo
    Paulo avatar
    2 posts
    Member since:
    Apr 2011

    Posted 31 Oct 2011 Link to this post

    Hello guys I'm experiencing slow load performance with this simple code:
    using System.Linq;
    using System.Windows;
    using System.Windows.Data;
    using System.Collections.ObjectModel;
    using Telerik.Windows.Controls;
    using Telerik.Windows.Controls.GridView;
      
    namespace SilverlightApplication1
    {
        public partial class MainPage 
        {
            public MainPage()
            {
                InitializeComponent();
                gv.AutoGenerateColumns = false;
                gv.EnableRowVirtualization = true;
                gv.Columns.Add(new GridViewDataColumn2("ID"));
                gv.Columns.Add(new GridViewDataColumn2("Name"));
                DataContext = new ObservableCollection<MyObject>(from i in Enumerable.Range(0, 1000) select new MyObject { Id = i, Name = string.Format("Name{0}", i) });
            }
        }
      
        public class GridViewDataColumn2 : GridViewDataColumn
        {
            private readonly string _propertyName;
      
            public GridViewDataColumn2(string propertyName)
            {
                _propertyName = propertyName;
            }
      
            public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem)
            {
                var auc = new RadMaskedTextInput();
                auc.SetBinding(RadMaskedTextInput.ValueProperty, new Binding(_propertyName));
      
                return auc;
            }
        }
      
        public class MyObject
        {
            public int Id { get; set; }
            public string Name { get; set; }
        }
    }
    Xaml:
    <UserControl x:Class="SilverlightApplication1.MainPage"
        xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
        mc:Ignorable="d"
        d:DesignHeight="300" d:DesignWidth="400">
      
      <ScrollViewer x:Name="LayoutRoot" Background="White">
        <Controls:RadGridView x:Name="gv" ItemsSource="{Binding}" />
      </ScrollViewer>
    </UserControl>


    The problem is on Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureChild(class System.Windows.UIElement,valuetype System.Windows.Size,int32)  Telerik.Windows.Controls.GridView.dll because it is causing an unwanted MeasureOverride.


  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 01 Nov 2011 Link to this post

    Hello,

     I strongly suggest you to read our documentation!

    Measuring UI virtual items controls like RadGridView, DataGrid, ListBox, etc. with infinity will turn off the virtualization and the component will try to create all UI containers at once. 

    Greetings,
    Vlad
    the Telerik team

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

  3. Peter
    Peter avatar
    19 posts
    Member since:
    Sep 2011

    Posted 29 Nov 2011 Link to this post

    Where is that in your documentation?

    Is it better than this documentation:  

  4. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 30 Nov 2011 Link to this post

    Hi,

     Here is it:
    http://www.telerik.com/help/silverlight/gridview-troubleshooting-performance.html

    Greetings,
    Vlad
    the Telerik team

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

  5. Peter
    Peter avatar
    19 posts
    Member since:
    Sep 2011

    Posted 14 Dec 2011 Link to this post

    Actually, telerik was causing a bug in .net's UIAutomation code to surface..  

    for more info:
    http://social.msdn.microsoft.com/Forums/en/windowsaccessibilityandautomation/thread/6c4465e2-207c-4277-a67f-e0f55eff0110

Back to Top