Gridview rowupdating keys

To do this we first need to obtain the reference of the current row by using its index no as shown in the first line below.

By using the Grid View Row object we can find the reference of any control in the row in which user is editing the data.

In this tutorial we are searching for our Text Box controls txt Product Name and txt Unit Price.

To get the Primary Key reference we can use the Data Keys collection of the Grid View.

In the above tutorial I tried to give you one of the easiest solutions and I hope you can go explore Grid View control editing further after learning the basics from this tutorial.

This can be achieved by setting the property Allow Client Editing to true without the need to define Template Columns.

You just have to double click on a cell to make it editable, edit the values and then change selection to some other row to save the updated values.

These properties will automatically render Edit, Update and Cancel buttons inside Grid View column.

I am using Template Field’s Item Template and Edit Item Template for providing read only and editing interface of the same column in the Grid View.

Search for gridview rowupdating keys:

gridview rowupdating keys-58

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “gridview rowupdating keys”

  1. Stored Procedure for SELECT set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[USERMST_INSERT] @NAME AS NVARCHAR(256), @ADD AS NVARCHAR(256), @CITY AS NVARCHAR(256), @EMAIL AS NVARCHAR(256) AS BEGIN INSERT INTO USERMST VALUES (@NAME,@ADD,@CITY,@EMAIL) END set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[USERMST_UPDATE] @ID AS INT, @NAME AS NVARCHAR(256), @ADD AS NVARCHAR(256), @CITY AS NVARCHAR(256), @EMAIL AS NVARCHAR(256) AS BEGIN UPDATE  USERMST SET [email protected], [email protected], [email protected], [email protected] WHERE [email protected] END Now, we all know as write sql connection code in data access layer.

  2. Eventbrite, and certain approved third parties, use functional, analytical and tracking cookies (or similar technologies) to understand your event preferences and provide you with a customised experience.