Skip to main content

Some Useful Coding Related To DataList,GridView etc.

A GridView is a databound control that we generally used to show the records related to our interest.A gridView have a number of method,events as well as properties .We will mention some of these events.

Events of a Gridview


DataBinding---Occurs when the server control binds to a data control

DataBound---Occurs after the server control bind to a data source.

Disposed---Occurs when a server control is released from the memory,which is the last stage of the server control lifycycle when asp.net page is requested!


Init---Occur when the server control is initialised.Which is the first step of the lifecycle.


Load ---Occur when the server control is loaded into the page object


PageIndexChanged--Occur when one of the pager button is clicked ,but after the gridview control handles the paging operation.


PageIndexchanging----Occurs when one of the pager button is cliecked,but before the gridview control handles the paging operation.


PreRender--- Occur after the control object is loaded .but prior to rendering.

RowCommand---Occur when a button is clicked in a gridview control.

RowCreated--When when a row is a created in a gridview control

RowDataBound---Occur when a datarow is bound to data in gridview control.

RowDeleted---Occurs when a row's Delete button is clicked, but after the GridView control deletes the row.


RowDeleting---Occurs when a row's Delete button is clicked, but before the GridView control deletes the row.

RowEditing--Occurs when a row's Edit button is clicked, but before the GridView control enters edit mode.

RowUpdated--Occurs when a row's Update button is clicked, but after the GridView control updates the row.

RowUpdating--Occurs when a row's Update button is clicked, but before the GridView control updates the row.

SelectedIndexChanged---Occurs when a row's Select button is clicked, but after the GridView control handles the select operation.

SelectedIndexChanging---Occurs when a row's Select button is clicked, but before the GridView control handles the select operation.

Sorted--Occurs when the hyperlink to sort a column is clicked, but after the GridView control handles the sort operation.

Sorting---Occurs when the hyperlink to sort a column is clicked, but before the GridView control handles the sort operation.

Unload---Occurs when the server control is unloaded from memory. (Inherited from Control.)

Comments