Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
640
Improve loading time and Scrolling with XamDataGrid
posted

Hi,

we are using the XamDataGrid in our application. We see some problems with the loading time of the form when having a lot of records. 

I'm trying to use virtualization with XamDataGrid but I think I'm doing something wrong.

When enabling the virtualization properties it doesnt perform better.

            xamDataGrid.FieldSettings.AllowCellVirtualization = true;

            xamDataGrid.FieldSettings.AllowLabelVirtualization = true;

            xamDataGrid.RecordContainerGenerationMode = Infragistics.Windows.Controls.ItemContainerGenerationMode.Virtualize;

            xamDataGrid.RecordLoadMode = RecordLoadMode.PreloadRecords;

 

When I embed the XamDataGrid into a VirtualizingStackPanel it does perform well. I gain 50% performance but the grid isn't visible. Why? I don't know yet.

            VirtualizingStackPanel _performancePanel = new VirtualizingStackPanel();

            _performancePanel = new VirtualizingStackPanel();

            Setter setter = new Setter();

            setter.Property = VirtualizingStackPanel.VirtualizationModeProperty;

            setter.Value = VirtualizationMode.Recycling;

            Style style = new Style();

            style.Setters.Add(setter);

            setter.Property = VirtualizingStackPanel.IsVirtualizingProperty;

            setter.Value = true;

            style.Setters.Add(setter);

            xamDataGrid.Style = style;

            _performancePanel.Children.Add(xamDataGrid);

            _performancePanel.IsItemsHost = true;

            this.Content = xamDataGrid;

 

Can you help me using Virtualization the right way?

With kind regards,

Patrick