hi team,
We are facing an issue with Xamdatagrid. While loading data into xamdatagrid UI freeze for few seconds. there is around 35000 records.
I want to load data without freezing the UI. if you can send any sample that will be good.
Required Dlls:
1: InfragisticsWPF4.DataPresenter.v15.1.dll
2:InfragisticsWPF4.Editors.v15.1.dll
3:InfragisticsWPF4.v15.1.dll
Debug.zip
Hello Suraj,
Thank you for contacting Infragistics. Are you trying to expand all the records on load? I don't experience any delay when simply loading, in either 15.1 or 18.2, but if you are trying to expand then all the hierarchies then it would be noticeable.
However, if you are trying to expand all the records, you can handle the grid's IntializeRecord event and use a Dispatcher.BeginInvoke and perform one of the grid's commands called ToggleRecordIsExpanded. This will prevent any "lock-up" behavior you might be seeing.
eg.
private void XamDataGrid1_InitializeRecord(object sender, Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs e) { Dispatcher.BeginInvoke((Action)(() => { XamDataGrid1.ExecuteCommand(DataPresenterCommands.ToggleRecordIsExpanded, e.Record); })); }
I attached a sample, using your XML, that demonstrates this. Please review it and let me know how long it takes for the data to load or if you have any questions.
3542.WpfApp1.zip
Hanging of Xamdatagrid is about 2~3 sec. Between Load data click and data viewed on UI. The time gap is about 2~3 sec between which I cannot move the UI also other functionalities stuck. I want to narrow down this time. Or Load data in async mode/thread so that other functionality works parallel.
Does the delay occur in my sample? If not, please modify my sample and resend it here. Let me know if you have any additional questions.
hi Michael,
I tried with your sample. but you made the sample in .net framework 4.7.2. with Infragistics dll v 18.1. where as we are using .net framework 4.6.2 with 15.1. does this makes the difference in loading time and hang issue, because the same I am experiencing in your sample also. I just made some changes, I am loading data on button click only. Also I am using xamdatagrid with simple row wise record.
* I could not found any button to upload the sample, so I am uploading the code. Please made changes .net framework 4.6.2 with 15.1. in the same sample 3542.WpfApp1.zip :
C# :-----------------------------
namespace WpfApp1{ /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent();
}
private void XamDataGrid1_InitializeRecord(object sender, Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs e) { Dispatcher.BeginInvoke((Action)(() => { XamDataGrid1.ExecuteCommand(DataPresenterCommands.ToggleRecordIsExpanded, e.Record);
})); }
private void Button_Click(object sender, RoutedEventArgs e) { XmlDocument doc = new XmlDocument(); doc.Load(@"..\\..\\XML\\dataset.xml");
// prepare xmldataprovider XmlDataProvider provider = new XmlDataProvider();
if (provider != null) { provider.Document = doc; provider.XPath = "";
// replicated binding code in code-behind Binding binding = new Binding(); binding.Source = provider; binding.XPath = "";
// bind to xamdatagrid XamDataGrid1.SetBinding(XamDataGrid.DataSourceProperty, binding); } } }}
XAML:------------------
<Grid x:Name="layoutRoot"> <Button Click="Button_Click" Content="Load Data" VerticalAlignment="Top"/> <igDP:XamDataGrid x:Name="XamDataGrid1" Margin="0,20,0,0" InitializeRecord="XamDataGrid1_InitializeRecord" /> </Grid>
Hello,
Thank you for following up. Are you looking to expand all records at runtime after the grid is bound? Expanding all the records does appear to be what's causing the behavior.
hello,
There is no tree structure in our application, please see the screen sort, It's a linear grid. Cell may have there CellValuePresenterStyle but rows/records are not expanding. we have two tabs and both having datagrids with 35000 records. As of now in my system (Win 10, 8Gb Ram) I am experiencing a ~2-3sec of lag to loading data or tab switch, between which the system stops taking any input either from mouse or keyboard. This is what I want to remove.
Please confirm which build of 15.1 you are using. I do advise updating to the latest service release for 15.1 if you cannot upgrade to 18.1 at this time because we fixed a memory issue back in 15.1 specifically with updating the grid's DataSource after switching tabs. The build linked above is 2252 for 15.1.