TreelistView performance; expanding+horizontal scroll

3 posts, 0 answers
  1. Jatinder
    Jatinder avatar
    12 posts
    Member since:
    Oct 2011

    Posted 20 Mar 2012 Link to this post

    Hi 

    I am having really bad performance issues with a small data set, both scrolling horizontally and with expanding rows.
    I have 20 columns and a mere 50 rows in my test application. With real data i expect the same columns but with maybe 100-300 rows.

    I am using latest internal binaries. I am using no converters, no style selectors (i am using column groups but even removing those dont help).... so all in all a very vanilla test.

    My horizontal scrolling is slow and choppy with just 25 columns
    My Expanding rows is dreadful almost like a 1-2 seconds to expand!!!

    Looking at the concerns in the previous post with measureoveride being called for each cell and row I am not sure what i should be doing to fix the performance?? Apart from your (Vlad's) previous post which is to try to hack into the gridview to make my scenario work with a custom expand column?

    As for my use cases - i dont need any filtering, sorting. 
    Just expanding rows, drag and dropping rows, cell editing, column groups

    Please help.

    Attached is my desired final UI. I can provide source code to my sample application if someone wants to have a look

  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 20 Mar 2012 Link to this post

    Hi,

     I've already answered your other post. If you do not need hierarchical sorting and/or filtering you can use the approach I've used in the attached application.

    Kind regards,
    Vlad
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
  4. Jatinder
    Jatinder avatar
    12 posts
    Member since:
    Oct 2011

    Posted 20 Mar 2012 Link to this post

    Hi Vlad

    I am trying to work on your sample application to make sure all my scenarios are handled which i could with the treelistview.

    I am trying to enable validation on the custom column but it doesnt behave like validation on another column.

    Its a textbox as my edit item. When validation error happens firstly - it doesnt show a red outline around the textblox. I am guessing its not picking up the styles from theme? 

    here is the altered code: 

    public override System.Windows.FrameworkElement CreateCellElement(Telerik.Windows.Controls.GridView.GridViewCell cell, object dataItem)
            {
                var col = cell.Content as StackPanel;
      
                if (col == null)
                {
                    col = new StackPanel(){Orientation = Orientation.Horizontal};
      
                    var toggleButton = new GridViewToggleButton() { PresentationMode = GridViewToggleButtonPresentationMode.Arrow };
                    toggleButton.SetBinding(GridViewToggleButton.IsCheckedProperty,
                        new Binding("IsExpanded") { Source = cell.ParentRow, Mode = BindingMode.TwoWay });
      
                    var tex = new TextBlock();
                    tex.SetBinding(TextBlock.TextProperty, new Binding("Name") { Source = dataItem, Mode = BindingMode.TwoWay });
      
                    col.Children.Add(toggleButton);
                    col.Children.Add(tex);
                }
      
                cell.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Left;
      
                cell.SetBinding(GridViewCell.PaddingProperty,
                    new Binding("Level") { Source = dataItem, Converter = new MyLevelToThicknessConverter() });
      
                return col;
            }
      
            public override System.Windows.FrameworkElement CreateCellEditElement(GridViewCell cell, object dataItem)
            {
                var cellEditElement = new TextBox();
                this.BindingTarget = TextBox.TextProperty;
                System.Windows.Data.Binding valueBinding = this.CreateValueBinding();
                cellEditElement.SetBinding(TextBox.TextProperty, valueBinding);
                cellEditElement.Margin = cell.Padding;
                cellEditElement.Height = cell.ActualHeight - 4;
                cellEditElement.HorizontalAlignment = HorizontalAlignment.Stretch;
                return cellEditElement as FrameworkElement;
            }
      
      
            private Binding CreateValueBinding()
            {
                System.Windows.Data.Binding valueBinding = new System.Windows.Data.Binding();
                valueBinding.Mode = BindingMode.TwoWay;
                valueBinding.NotifyOnValidationError = true;
                valueBinding.ValidatesOnExceptions = true;
                valueBinding.UpdateSourceTrigger = UpdateSourceTrigger.Explicit;
                valueBinding.Path = new PropertyPath(this.DataMemberBinding.Path.Path);
                return valueBinding;
            }

Back to Top