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

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

--dialog.razor


--dialog.razor


--datagrid.razor







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, 
 
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. 
  1. Share the sample which you have tried from your side. So that we could validate the problem based on your scenario.
  2. If possible reproduce the problem with the attached sample and share with us for further analysis.
  3. Share the details of any script error or exception when calling the Refresh method after AddTask.
  4. 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.  
 
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
Loader.
Live Chat Icon For mobile
Up arrow icon