Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
select

Grid / Entity Framework Manual Operations

Next database reset in 0 hours, 48 minutes, 47 seconds
Add new recordRefresh
  TitleNameCompanyCountryCityPhone
  
Page size:
select
 88 items in 9 pages
OwnerAna TrujilloAna Trujillo Emparedados y heladosMexicoMéxico D.F.(5) 555-4729
OwnerAntonio MorenoAntonio Moreno TaqueríaMexicoMéxico D.F.(5) 555-3932
Sales RepresentativeThomas HardyAround the HornUKLondon(171) 555-7788
Order AdministratorChristina BerglundBerglunds snabbköpSwedenLuleå0921-12 34 65
Sales RepresentativeHanna MoosBlauer See DelikatessenGermanyMannheim0621-08460
Marketing ManagerFrédérique CiteauxBlondesddsl père et filsFranceStrasbourg88.60.15.31
OwnerMartín SommerBólido Comidas preparadasSpainMadrid(91) 555 22 82
OwnerLaurence LebihanBon app'FranceMarseille91.24.45.40
Accounting ManagerElizabeth LincolnBottom-Dollar MarketsCanadaTsawassen(604) 555-4729
Sales RepresentativeVictoria AshworthB's BeveragesUKLondon(171) 555-1212

  • The current example demonstrates RadGrid's capability for inserting new data, updating existing data and deleting data manually, using Entity Framework.

    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.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="VB" CodeFile="DefaultVB.aspx.vb" Inherits="Telerik.GridExamplesVBNET.DataEditing.EntityFrameworkCRUD.DefaultVB" %>

    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <%@ Register Assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag ID="Headtag1" runat="server"></qsf:HeadTag>
    </head>
    <body class="BODY">
        <form id="form1" runat="server">
        <div>
            <qsf:Header ID="Header1" runat="server" NavigationLanguage="VB" ShowDbResetTimer="true" />
            <!-- content start -->
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
                <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true" AllowSorting="true"
                    AllowFilteringByColumn="true">
                    <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="false" DataKeyNames="CustomerID"
                        InsertItemPageIndexAction="ShowItemOnCurrentPage">
                        <Columns>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton" />
                            <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                                ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" ConfirmDialogHeight="100px"
                                ConfirmDialogWidth="220px" />
                            <telerik:GridTemplateColumn DataField="CustomerID" HeaderText="CustomerID" UniqueName="CustomerID"
                                Visible="false">
                                <InsertItemTemplate>
                                    <telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Bind("CustomerID") %>'
                                        Width="150px" />
                                </InsertItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Eval("CustomerID") %>'
                                        ReadOnly="true" Width="150px" />
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="ContactTitle" HeaderText="Title" UniqueName="ContactTitle" />
                            <telerik:GridBoundColumn DataField="ContactName" HeaderText="Name" UniqueName="ContactName" />
                            <telerik:GridBoundColumn DataField="CompanyName" HeaderText="Company" UniqueName="CompanyName" />
                            <telerik:GridBoundColumn DataField="Country" HeaderText="Country" UniqueName="Country" />
                            <telerik:GridBoundColumn DataField="City" HeaderText="City" UniqueName="City" />
                            <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone" UniqueName="Phone" />
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
            </telerik:RadAjaxPanel>
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server" />
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
            <!-- content end -->
            <qsf:Footer ID="Footer1" runat="server"></qsf:Footer>
        </div>
        </form>
    </body>
    </html>

Get more than expected!

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2012 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451