Rowupdating event in gridview

) has been previously blogged by Mark Cassidy but I guess it depends on what symptom you’re having first, and wether you relate it back to this obscure setting. Grid View to This issue does now have a fleeting mention on While looking for that link, I also came across another blog post detailing the same issue and frustrations I’ve had with Gridview events that may have more detail.

In my case, I was previously aware of this issue but only relating to apparent loss of viewstate on controls.

Which means I won’t make my 70% code reduction Microsoft has always promised me.

The visitors to a web site can typically be divided into two groups: the users and the administrators.

In the Page_Load event, you simply load your data from the database and bind it with the Grid View control as shown below: For brevity I am not storing connection string in the web.config and also not using any Data Access Component.

Next event is the Grid View Row Editing event to give ASP. You need to set the Edit Index property of the Grid View with the New Edit Index property of the Grid View Edit Event Args class.

Editing the Grid View control can be an incredibly easy feature to add for certain database tables, especially those who have no foreign key associated and can easily be edited through the use of a standard Text Box web control as shown in the figure below: 1.

You need to include the Grid View Command Field column to add Edit, Update and Cancel Buttons in the Grid View. You need to include Template Field for every column you want to provide Editing because Template Field provides you both Item Template and Edit Item Template to create interface for two separate Grid View modes. You need to handle Grid View events such as Row Editing, Row Canceling Edit and Row Updating to provide desired editing functionality.

For a while now I’m trying to figure out why my method, triggered by the Grid View.

Row Updating event, doesn’t work as all samples say it should do.

First, I load up some data: After that, I’m doing some work to make my Grid View look beautifull, adding all columns by hand.

But for this demo, I’ll show you the simple version, that also doesn’t work 🙂Let’s bind the data to our Grid View and have it autogenerate our columns, as well as an edit button.

For example a Sql Data Source, which is automatically added to your Web Form if you drag-n-drop your way around Visual Studio 2005.

516 Comments

  1. Watch live streaming broadcast quality Indonesia cameras showcasing famous and well known landmarks in Indonesia.

  2. Our easy to use dating software allows our members to connect with other members quickly and conveniently making finding casual sex in Oldbury easy.

Comments are closed.