All Controls


Rate this demo

Thank you for your post!
Submit a support ticket
If you have an active license or trial, you have access to dedicated support from Telerik’s developers. Response time is 24h for active licenses and 72h for trials, Mon-Fri.
Post in the forums
If you don’t have access to support or would like to help other people by sharing your problem, reach out to our active community in the forums.

Grid - Automatic Operations

Next database reset in 1 hours, 28 minutes, 43 seconds
Command item
Command item
Add new recordRefresh
Data pager
Data pager
Page size:
 91 items in 10 pages
Alejandra CaminoRomero y tomilloAccounting Manager(91) 745 6202
Alexander FeuerMorgenstern GesundkostMarketing Assistant0342-023176
Ana TrujilloAna Trujillo Emparedados y heladosOwner(5) 555-4729
Anabela DominguesTradição HipermercadosSales Representative(11) 555-2167
André FonsecaGourmet LanchonetesSales Associate(11) 555-9482
Ann DevonEastern ConnectionSales Agent(171) 555-0297
Annette RouletLa maison d'AsieSales Manager61.77.61.10
Antonio MorenoAntonio Moreno TaqueríaOwner(5) 555-3932
Aria CruzFamilia ArquibaldoMarketing Assistant(11) 555-9857
Art BraunschweigerSplit Rail Beer & AleSales Manager(307) 555-4680

The current ASP.NET Grid example demonstrates RadGrid's capability for inserting new data, updating existing data and deleting data against an EntityDataSource. The only thing that is required of you is to configure the entity data source by incuding the correpsonding database tables in the entity data model and set the following properties of the grid to true to propagate automatic update/insert/delete operations:

  • 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).

You may also see how to utilize Telerik OpenAccess ORM as a data access layer for our AJAX controls by visiting the OpenAccess ORM live demos here.

Show code in new window Demo isolation steps
<%@ Page Language="C#" CodeFile="DefaultCS.aspx.cs" Inherits="defaultcs"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<html xmlns=''>
<head runat="server">
    <title>Automatic CRUD operations in ASP.NET AJAX Grid | RadGrid demo</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="EntityDataSourceCustomers"
        AllowPaging="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="True"
        AllowAutomaticDeletes="true" AllowSorting="true" OnItemCreated="RadGrid1_ItemCreated"
        OnItemInserted="RadGrid1_ItemInserted" OnPreRender="RadGrid1_PreRender">
        <PagerStyle Mode="NextPrevAndNumeric" />
        <MasterTableView DataSourceID="EntityDataSourceCustomers" AutoGenerateColumns="False"
            DataKeyNames="CustomerID" CommandItemDisplay="Top">
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                <telerik:GridBoundColumn DataField="CustomerID" HeaderText="CustomerID" SortExpression="CustomerID"
                    UniqueName="CustomerID" Visible="false" MaxLength="5">
                <telerik:GridBoundColumn DataField="ContactName" HeaderText="ContactName" SortExpression="ContactName"
                <telerik:GridBoundColumn DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName"
                <telerik:GridBoundColumn DataField="ContactTitle" HeaderText="ContactTitle" SortExpression="ContactTitle"
                <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone" SortExpression="Phone"
                <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton" />
                <EditColumn ButtonType="ImageButton" />
    <asp:EntityDataSource ID="EntityDataSourceCustomers" runat="server" ConnectionString="name=NorthwindReadWriteEntities"
        DefaultContainerName="NorthwindReadWriteEntities" EntitySetName="Customers" OrderBy="it.[ContactName]"
        EntityTypeFilter="Customer" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" >