I will be using Sql objects directly into methods to keep the example simple and straight forward.
In practical scenario you should use your existing architecture to populate and update the data.
So I have to specify how I want them to appear in the normal view and edit view.
That’s why I have placed different templates like Item Template (for normal view) and Edit Item Template (for edit view).
aspdotnet-suresh offers C#articles and tutorials,csharp dot net,articles and tutorials, VB.
Net Grid View Add (Insert), Edit, Update and Delete functionality, but this is different and how I’ll explain as we progress.
On the onclick event if the button the records are inserted into the SQL Server Database and the Grid View is updated You can view above I am simply getting the data from the textboxes in the Footer Row and then firing an update query along with the select query so that the ASP. The figure below displays the Edit and Update functionality.
In this example I will give you a complete solution on “How to operate Check Box List in Grid View Edit Mode“ CREATE TABLE [dbo].[Brand]( [ID] [bigint] NOT NULL, [Name] [varchar](max) NOT NULL, CONSTRAINT [PK_Brand] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] CREATE TABLE [dbo].[Product]( [ID] [bigint] NOT NULL, [Name] [varchar](max) NULL, [Description] [varchar](max) NULL, [Brand ID] [bigint] NULL, CONSTRAINT [PK_Product_2] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] INSERT INTO Brand Values(1,'Kohinoor') INSERT INTO Brand Values(2,'Proctor & Gamble') INSERT INTO Brand Values(3,'Telenor') INSERT INTO Brand Values(4,'Unilever') INSERT INTO PRODUCT VALUES(1,'Lux Beauty Soap','Product of Unilever',4) INSERT INTO PRODUCT VALUES(2,'Tibbet Pomed','Winter Product',1) INSERT INTO PRODUCT VALUES(3,'Data SIM','Subscriber Identity Module',3) INSERT INTO PRODUCT VALUES(4,'Nippon','Color Television',1) Note: If you look at the Grid View events you will get onrowdatabound, onrowupdating, onrowediting, onrowcancelingedit events. Like onrowdatabound event will fire when Grid View Data Bind() method was called, onrowediting event will fire when user click on Edit link, onrowupdating event will fire when user click on Update link & onrowcancelingedit will fire when user click on Cancel link. column which will act as custom column for delete functionality.The reason to use a custom button is to provide the Java Script confirmation box to the user when he clicks Delete.I have specified Data Key Names as Auto ID, the primary key of the database table.Then I have several methods attached with following events Get video of hundreds of ASP. On Row Editing - Edit Record On Row Cancel Edit - Cancel Record On Row Updating - Update Record On Row Deleting - Delete Record As I set Auto Generate Columns property to false so I am going to manually write the fields name that I need to appear in the way I want.