Reader Level:

Enhanced Editing Support in .NET 4.5

On October 07, 2012 Articles | .NET 4.5
Today, in this article let’s play around with one of the interesting and most useful concepts in .NET 4.5.
  • 0
  • 0
  • 2439


Today, in this article let's play around with one of the interesting and most useful concepts in .NET 4.5.

Question: What is enhanced editing support?

In simple terms "It provides enhanced editing support with various methods invocation as per the usage".

Step 1: Create a new "ASP.Net Web Forms Application", as in:

Step 2: Create an Entity Data Model Framework and set it up with an appropriate database.

Step 3: The complete code of webform1.aspx looks like this:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="EnhancedEditingSupportApp.WebForm1" %>

<!DOCTYPE html>

<html xmlns="">

<head id="Head1" runat="server">




    <form id="form1" runat="server">



            <asp:GridView ID="GridView1" runat="server" BackColor="LightGoldenrodYellow" ItemType="EnhancedEditingSupportApp.Employee"

                BorderColor="Tan" BorderWidth="1px" CellPadding="2" ForeColor="Black" GridLines="None"

                AutoGenerateColumns="false" SelectMethod="GetData" UpdateMethod="UpdateData"


                <AlternatingRowStyle BackColor="PaleGoldenrod"></AlternatingRowStyle>

                <FooterStyle BackColor="Tan"></FooterStyle>

                <HeaderStyle BackColor="Tan" Font-Bold="True"></HeaderStyle>

                <PagerStyle HorizontalAlign="Center" BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue">


                <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite"></SelectedRowStyle>

                <SortedAscendingCellStyle BackColor="#FAFAE7"></SortedAscendingCellStyle>

                <SortedAscendingHeaderStyle BackColor="#DAC09E"></SortedAscendingHeaderStyle>

                <SortedDescendingCellStyle BackColor="#E1DB9C"></SortedDescendingCellStyle>

                <SortedDescendingHeaderStyle BackColor="#C2A47B"></SortedDescendingHeaderStyle>


                    <asp:BoundField DataField="Id" HeaderText="ID" ReadOnly="true" />

                    <asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />

                    <asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" />

                    <asp:BoundField DataField="Age" HeaderText="Age" SortExpression="Age" />








Step 4: The complete code of webform1.aspx.cs looks like this:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

namespace ModelBindersSelectApp


    public partial class WebForm1 : System.Web.UI.Page


        protected void Page_Load(object sender, EventArgs e)



        public IQueryable GetData()


            return objEntities.Employee;


        public void UpdateData(Employee employee)


            objEntities.Entry(employee).State = System.Data.EntityState.Modified;



        #region Instance VariablesCompanyEntities objEntities = new CompanyEntities();




Step 5: The output of the application looks like this:

Step 6: The data editing output of the application looks like this:

Step 7: The data edited output of the application looks like this:

Vijay Prativadi

Hey Everyone, It's Vijay. I am SDE mostly up on Microsoft Technologies. If you are thinking to know what I do mostly when at work. I get a chance to work upon few Microsoft technologies. All the wa...

  • 11rank
  • 2M readers
  • 2times

Trending up