Hi Technical Support;
I am using WinForms control SfDataGrid (Vesion 19.3.0.53), in Visual Studio 2019 (
Version 16.11.7) .Net5.0 Framefork, EntityFrameforkCore5.0.12, SQLExpress DB, on the following way:
LabclinicFiscal dbcontext = new LabclinicFiscal();
sfDataPagerInvoiceReq.DataSource = dbcontext.OrderRequest.ToList();
sfDataPagerInvoiceReq.PageSize = 30;
sfDataGridInvoiceReq.DataSource = sfDataPagerInvoiceReq.PagedSource;
sfDataGridInvoiceReq.LiveDataUpdateMode = LiveDataUpdateMode.AllowDataShaping;
.......
After adding a new record (or updating record) to the Database table OrderTequest, using EF service to create a new record, and the end refresh DataGrid:
this.sfDataGridInvoiceReq.View.Refresh();
I can not see new row data in sfDataGrid. After restarting the Form of SfDataGrid, a new row is visible.
How to resolve this issue.
If I repeat SfDataGrid initialization at the and of EF Add service:
sfDataPagerInvoiceReq.DataSource = dbcontext.OrderRequest.ToList();
sfDataPagerInvoiceReq.PageSize = 30;
sfDataGridInvoiceReq.DataSource = sfDataPagerInvoiceReq.PagedSource;
sfDataGridInvoiceReq.LiveDataUpdateMode = LiveDataUpdateMode.AllowDataShaping;
this.sfDataGridInvoiceReq.View.Refresh();
It is working fine.
Please advise me on the right approach.
Kind regards,
Zoran
}