Fetching time

2 posts, 0 answers
  1. James
    James avatar
    1 posts
    Member since:
    Mar 2016

    Posted 16 Mar Link to this post

    Hi,

    I am testing the DataGrid control in order to use it in a project and I am wondering if the time that it takes to render the grid at the view when scrolling can be improved. It has a huge amount of data and it's just a few miliseconds but it would be great if this can be improved and none blank "gaps" appear.

    Also, when I try to scroll and there is nothing to scroll, there is a bounce effect, is it possible to disable that?

    Finally, is there a way of merging cells as it is done in WinForms?

    Thanks,
    James

    01.<Page
    02.    x:Class="App1.MainPage"
    05.    xmlns:local="using:App1"
    08.    xmlns:Grid="using:Telerik.UI.Xaml.Controls.Grid"
    09.    mc:Ignorable="d">
    10.     
    11.    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    12.        <Grid:RadDataGrid
    13.            x:Name="Grid"
    14.            CanDrag="False"
    15.            UserColumnReorderMode="None"
    16.            UserSortMode="None"
    17.            ItemsSource="{Binding Rows}"
    18.            AutoGenerateColumns="False"
    19.            AllowDrop="False"
    20.            SelectionMode="Single"
    21.            SelectionUnit="Cell"
    22.            UserGroupMode="Disabled"
    23.            UserEditMode="None"
    24.            UserFilterMode="Disabled"
    25.            FrozenColumnCount="1"
    26.            IncrementalLoadingMode="Auto"
    27.            ScrollViewer.IsDeferredScrollingEnabled="False"
    28.            ScrollViewer.IsHorizontalScrollChainingEnabled="True"
    29.            ScrollViewer.IsVerticalScrollChainingEnabled="True"
    30.            ScrollViewer.IsScrollInertiaEnabled="True"
    31.            ScrollViewer.IsZoomChainingEnabled="False"
    32.            ScrollViewer.ZoomMode="Disabled"
    33.            ScrollViewer.VerticalScrollBarVisibility="Hidden"
    34.            ScrollViewer.HorizontalScrollBarVisibility="Hidden"
    35.            ManipulationMode="ScaleInertia"
    36.            >
    37.        </Grid:RadDataGrid>
    38.    </Grid>
    39.</Page>

     

    01.public sealed partial class MainPage : Page
    02.    {
    03.        public MainPage()
    04.        {
    05.            this.InitializeComponent();
    06.            this.DataContext = new TestViewModel();
    07.            InitGrid();
    08.        }
    09. 
    10.        public List<Row> Rows { get; set; }
    11. 
    12.        private void InitGrid()
    13.        {
    14.            Rows = new List<Row>();
    15.            for (int i = 0; i < 250; ++i) {
    16.                Rows.Add(new Row());
    17.            }
    18. 
    19.            Random r = new Random();
    20.            for (int i = 0; i < 250; ++i) {
    21. 
    22.                StringBuilder sb = new StringBuilder();
    23.                sb.Append("<DataTemplate xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">");
    24.                sb.Append("<Grid Width=\"60\">");
    25.                sb.Append("<TextBlock Margin=\"1\" HorizontalAlignment=\"Center\" Text=\"{Binding Path=Values[" + i.ToString() + "], Mode=OneWay}\" FontSize =\"18\" Foreground=\"Black\" />");
    26.                sb.Append("</Grid>");
    27.                sb.Append("</DataTemplate>");
    28.                DataTemplate datatemplate = (DataTemplate)XamlReader.Load(sb.ToString());
    29. 
    30.                var col = new DataGridTemplateColumn();
    31.                col.Header = $"Column_{i}";
    32.                col.CellContentTemplate = datatemplate;
    33.                Grid.Columns.Add(col);
    34.            }
    35.        }
    36.    }

     

    01.public class TestViewModel
    02.    {
    03.        private Random random;
    04. 
    05.        public List<Row> Rows { get; set; }
    06. 
    07.        public TestViewModel()
    08.        {
    09.            random = new Random();
    10.            Rows = new List<Row>();
    11.            for (int i = 0; i < 250; ++i)
    12.            {
    13.                Rows.Add(new Row());
    14.            }
    15.        }
    16.     
    17.    }
    18.    public class Row
    19.    {
    20.        public Row() {
    21.            var r = new Random();
    22.            Values = new List<string>();
    23.            for (int i = 0; i < 250; ++i)
    24.            {
    25.                string s = GenerateName(r.Next(7));
    26.                Values.Add(s);
    27.            }
    28.        }
    29. 
    30.        public List<string> Values { get; set; }
    31. 
    32.        private static string GenerateName(int len)
    33.        {
    34.            Random r = new Random();
    35.            string[] consonants = { "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "l", "n", "p", "q", "r", "s", "t", "v", "w", "x" , "y", "z" };
    36.            string[] vowels = { "a", "e", "i", "o", "u" };
    37.            string Name = "";
    38.            Name += consonants[r.Next(consonants.Length)].ToUpper();
    39.            Name += vowels[r.Next(vowels.Length)];
    40.            int b = 2;
    41.            while (b < len)
    42.            {
    43.                Name += consonants[r.Next(consonants.Length)];
    44.                b++;
    45.                Name += vowels[r.Next(vowels.Length)];
    46.                b++;
    47.            }
    48.            return Name;
    49.        }
    50.    }

  2. Ivaylo Gergov
    Admin
    Ivaylo Gergov avatar
    661 posts

    Posted 21 Mar Link to this post

    Hello James,

    Thank you for your interest.

    Generally, we have plans to improve the performance of our RadDataGrid(our plan is to include Direct2D rendering option) but we do not have a specific time frame yet. Also, we intend to extend the Grid's API so that the developer can change the buffer size on top and at the bottom of the already realized items and avoid such gaps when scrolling.

    The merge cells feature is not supported and it is not part of our planning.

    Please, let me know should you need further assistance.

    Regards,
    Ivaylo Gergov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top