protected void myGridView_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { // Perform custom logic when a new row is created } }
protected void myGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { // Perform custom logic when a row is bound with data } }This example shows how to handle the RowDataBound event of a GridView control. The event handler checks if the row being bound is a data row and then performs custom logic accordingly. Package library: System.Web.