We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

SFDataGrid is throwing an error intermitandly

Hi,

I have a datagrid having a list as datasource.

It binds data as shown below

private void LoadRecordingGrid(List<ProcedureDataHeader> recordingData)

        {

            if (recordingData == null) return;

            if (recordingData != null && recordingData.Count > 0)

            {

                List<ProcedureDataHeader> recordingList = new List<ProcedureDataHeader>(recordingData);


                using (ProcedureDataHeaderManager dataHeaderManager = new ProcedureDataHeaderManager())

                {

                    byte[] notificationIcon = dataHeaderManager.ImageToByteArray(Images.NotificationReportIcon.ToBitmap());

                    recordingList.Where(m => m.UseNotification).ToList().ForEach(m => m.RecordingIcon = notificationIcon);

                }


                dgvRecordings.DataSource = recordingList;

                dgvRecordings.SetCustomFilterIcons();

                this.dgvRecordings.RecordContextMenu = this.contextMenuStripEcg;

            }

            else

            {

                this.dgvRecordings.RecordContextMenu = null;

            }

            dgvRecordings.Columns[0].HeaderText = "";

            dgvRecordings.ClearSelection();

        }

Grid Settings are :

this.dgvRecordings.AccessibleName = "Table";

            this.dgvRecordings.AllowEditing = false;

            this.dgvRecordings.AllowGrouping = false;

            this.dgvRecordings.AutoGenerateColumns = false;

            this.dgvRecordings.AutoSizeColumnsMode = Syncfusion.WinForms.DataGrid.Enums.AutoSizeColumnsMode.AllCellsWithLastColumnFill;

this.dgvRecordings.Columns.Add(gridImageColumn1);

            this.dgvRecordings.Columns.Add(gridTextColumn1);

            this.dgvRecordings.Columns.Add(gridTextColumn2);

            this.dgvRecordings.Columns.Add(gridTextColumn3);

            this.dgvRecordings.Dock = System.Windows.Forms.DockStyle.Fill;

            this.dgvRecordings.Location = new System.Drawing.Point(0, 0);

            this.dgvRecordings.Name = "dgvRecordings";

            this.dgvRecordings.PreviewRowHeight = 35;

            this.dgvRecordings.RecordContextMenu = this.contextMenuStripEcg;

            this.dgvRecordings.SerializationController = null;

            this.dgvRecordings.Size = new System.Drawing.Size(230, 626);

            this.dgvRecordings.Style.CurrentCellStyle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(166)))), ((int)(((byte)(216)))), ((int)(((byte)(255)))));

            this.dgvRecordings.Style.CurrentCellStyle.BorderThickness = Syncfusion.WinForms.DataGrid.Styles.GridBorderWeight.Thin;

            this.dgvRecordings.TabIndex = 0;

            this.dgvRecordings.Text = "dgvRecordings";

            this.dgvRecordings.QueryCellStyle += new Syncfusion.WinForms.DataGrid.Events.QueryCellStyleEventHandler(this.dgvRecordings_QueryCellStyle);

            this.dgvRecordings.SelectionChanged += new Syncfusion.WinForms.DataGrid.Events.SelectionChangedEventHandler(this.dgvRecordings_SelectionChanged);

It sometimes throw the error as follows

EventProcedureView: bwPatientData_RunWorkerCompleted(), "System.ArgumentNullException: Value cannot be null. Parameter name: source at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate) at Syncfusion.WinForms.DataGrid.SfDataGrid.RefreshViewAndContainer(Object oldValue, Object newValue) at Syncfusion.WinForms.DataGrid.SfDataGrid.<>c__DisplayClass79.<OnDataSourceChanged>b__78() at Syncfusion.WinForms.DataGrid.BusyIndicatorHelper.RunWork(SfDataGrid dataGrid, Action work, BusyIndicatorAction busyIndicatorAction, Boolean showBusyIndicator) at Syncfusion.WinForms.DataGrid.SfDataGrid.OnDataSourceChanged(Object oldValue, Object newValue) at Syncfusion.WinForms.DataGrid.SfDataGrid.set_DataSource(Object value) at BeaconEarrs.EventProcedureView.LoadRecordingGrid(List`1 recordingData) at BeaconEarrs.EventProcedureView.bwPatientData_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e)"


Since this error is not consistently happening, I don't have a trace of the issue.

Do you know why this is happening or any root cause of this issue ?

Can you please help ?

Thanks


1 Reply

VS Vijayarasan Sivanandham Syncfusion Team December 7, 2022 06:52 PM UTC

Hi Anooj baby,

We have tried to reproduce the reported issue based on the provided details, but we are unable to reproduce this from our end. Here, we have attached the tested sample demo in the attachment. Please have a look at this. Could you please confirm if we missed anything? If you are still facing the reported issue, modify the attached sample and share the video illustration of the reported issue. It will be helpful for us to check on it and provide you with a solution as soon as possible.

Regards,
Vijayarasan S


Attachment: SfDataGridDemo_457e7f67.zip

Loader.
Live Chat Icon For mobile
Up arrow icon