Telerik RadGrid provides rich server API for inserting new data, updating existing data
and deleting data directly from the specified data source (AccessDataSource, SqlDataSource or
ObjectDataSource). Keep in mind that you will have to configure the respective data source
control (including
update/insert/delete parameters to its definition) to trigger the
automatic operations. The new ASP.NET 2.0 framework allows using
these features entirely declaratively, except the error-handling logic.
You have to set the following properties of the grid to
true to propagate automatic update/insert/delete
operation:
- AllowAutomaticUpdates
- AllowAutomaticInserts
- AllowAutomaticDeletes
What is on this example:
- You can insert a new item using the [Add new record] button in the Command row.
- You can edit an item using the Edit button (the first button in each row).
- You can delete an item, using the Delete button (at the end of each row). When deleting an item a RadWindow
confirmation dialog is shown.
Note:
SessionDataSource is simply a tool used in this grid demo to prevent permanent changes
from be made to demo data. It is essentially an AccessDataSource that stores data in Session
so that no changes are persisted permanently to the database file.
You are free to use this assembly in your projects, but it is not necessary for
RadGrid to function. Unless you want to copy the telerik demo behavior in your own project,
you can remove this assembly from your project.
Further information about the automatic data source operations and error handling supported by
Telerik RadGrid is available in these resources:
Automatic data source operations
API for controlling automatic data source operations
Error handling
Automatic operations
with SqlDataSource control
Automatic operations
with ObjectDataSource control
Automatic operations
with SqlDataSource in hierarchical grid
Update/Insert/Delete with stored procedures and SqlDataSource control
Update/Insert/Delete with LinqDataSource control