Your question is a valid one but let me note the following
Lets asume you manage the addrow method
What it actually does it adds a new row in your grid and the related dataset
But when you try to update your database table you might come up with problems relating to data validation
What will happen if you have a DB table with a primary key that is a uniqueidentifier??
Of course in your grid you dont display a column that contains a uniqueidentifier value and of course you need to create a new value for it
My experience suggests the following
When you need to add data to a table underlying to a grid take control through code
My practice is to have a form that opens for the following actions
- Addnew record
- View record details ( because on the grid you may display a subset of the fields of the entire record)
- Update Record
Shown bellow the case of addnew record
On Save button click validate all data supplied by the user
Besides the shown 3 fields that require user data, and also are the only 3 fields shown in the datagrid, exist 5 other fields in the particular table that get values when user data validation is succesfull a and are reuired fields in the database table
Id which is of type uniqueindentifier and its value is created using code
DateCreated which is a field that gets the current date value on the save action
IdUsed which is a field that gets the value 0 on the save action but it is modified later in the application and notifies something
LastUserUpdated that takes the guid of the user that performed the action
LastDateModified that takes date value when the record is modified
Bellow shown the result of failed user data validation
The fields with wrong data are displayed with red color and **
The user should have entered an integer value in the field Unit Period and decimal value in the field Charge Value
Data validation informs the user of his error and avoids crashing due to SQL validation when you will try to add an invalid record
My suggestion is to take control using code when adding data to a db table
The grids and all the wonderfull components syncfusion has created are wonderfull for data representation and orgnization
BUT when it comes to adding data to a database I use code validation and I suggest you do the same