Datagrid refresh problem
Hi




I'm adding a new record to datagrid
when I add new record data grid doesn't reload
if I update it reloads
look at following code
Please help for this problem
regards
Cemil
Cemil
--dialog.razor
--dialog.razor
--datagrid.razor
SIGN IN To post a reply.
1 Reply
1 reply marked as answer
RS
Renjith Singh Rajendran
Syncfusion Team
July 23, 2020 03:59 PM UTC
Hi Cemil,
Greetings from Syncfusion support.
We have analysed your shared codes. We could see that you are cancelling the default Grid CRUD action and handling those actions in custom way. We suspect that you are adding the SelectedTask which you have created in OnToolbarClick handler to the Grid data list in your AddTask method.
So at these case scenarios, it is a must to call the Refresh() method of Grid to refresh the changes made to the List in Grid. We have prepared a sample based on this scenario, and we could not face the problem from our side. Calling Refresh after adding the record to Orders List is refreshing the Grid and the new record is displayed in Grid.
We are attaching the sample for your reference, please download the sample from the link below,
Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/DataGridBlazor-1492675803
Please refer the above sample, and if you are still facing difficulties, then we need more details to further proceed on this. Kindly get back to us with the following details for better assistance.
- Share the sample which you have tried from your side. So that we could validate the problem based on your scenario.
- If possible reproduce the problem with the attached sample and share with us for further analysis.
- Share the details of any script error or exception when calling the Refresh method after AddTask.
- Share the exact scenario you are facing the problem.
And also we would like to suggest you binding Observable Collection as data for Grid. If you want the dynamic changes to be updated in Grid without calling Refresh method, then you can bind data to Grid as ObservableCollection. Please refer the documentation and online sample demos showing CRUD operation with ObservableCollection as data in Grid.
Documentation : https://blazor.syncfusion.com/documentation/datagrid/data-binding/#observable-collection
And also we would like to inform you that, we have inbuilt support for Dialog/DialogTemplate modes of editing in Grid. Please refer the below documentations and online demos for more details,
Please get back to us if you need further assistance.
Regards,
Renjith Singh Rajendran
Marked as answer
SIGN IN To post a reply.