Protected void gridview1rowupdating object sender gridviewediteventargs e
On page load will call this function, and now whenever the page gets load, function gv Bind() gets call and data gets display. Now we are at the main part of this article .i.e we are going to bind dropdown list in Gridview which we placed under edit template.Just look at HTML markup you will see `ddl_department` named drop-down list added.To cancel the update operation, set the Cancel property of the Grid View Update Event Args object to .You can also manipulate the Keys, Old Values, and New Values collections, if necessary, before the values are passed to the data source.A Grid View Row Event Args object is passed to the event-handling method, which allows you to access the properties of the row that raised the event.
So now we added a drop-down list under edit template, which will display only on edit mode. This is a simple task, we made a common function `gv Bind()` which binds our Gridview control with data.
This allows you to provide an event-handling method that performs a custom routine, such as canceling the update operation, whenever this event occurs.
A Grid View Update Event Args object is passed to the event-handling method, which allows you to determine the index of the current row and to indicate that the update operation should be canceled.
Before the Grid View control can be rendered, a Grid View Row object must be created for each row in the control.
The Row Created event is raised each time a row in the Grid View control is created.