Data grid does not store new records to bottom of table

Hi, whenever I add a new record to the table and refresh the page, it orders the records by my primary key ('Id') which is not in numerical order.
I want new records to be stored at the bottom of the table and not ordered by my primary key. 
How do I make my table store new records to the bottom of the table?

'.razor'


Attachment: table_store_to_bottom_a6a09d6e.zip

1 Reply 1 reply marked as answer

VN Vignesh Natarajan Syncfusion Team May 12, 2021 05:31 AM UTC

Hi Kenney,  
 
Thanks for contacting Syncfusion support.  
 
Query: “I want new records to be stored at the bottom of the table and not ordered by my primary key. ” 
 
We have analyzed your query with the provided video demonstration and we understand that you are facing an issue with the inserted records in Grid after refreshing the browser page. From your code example, we understand that you have bound data to Grid using the DataSource property.  
 
We would like to inform you that by default for local data (DataSource property) CRUD actions needs to be handle in Grid action events to save the changes properly in the database. Once the records are inserted, Grid will be refreshed to bind the updated datasource to Grid. While refreshing, we will fetch the updated data from the DataSource property and display them in the same order in Grid. We will not perform any sorting operations in Grid based on the primary key.  
 
We suspect in your database, records are saved in that order. Hence while refreshing the page, records are inserted in a different position. If you have further queries, kindly share the following details to validate the reported query at our end.      
 
  1. Share the details about your OnActionComplete event. 
  2. How the records were inserted into your database.
  3. Kindly confirm how the records are saved in your database, once inserted. 
 
The above details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible.  
 
Regards, 
Vignesh Natarajan 
 


Marked as answer
Loader.
Up arrow icon