Wednesday, December 21, 2011

Grid view Serial No count will be generated automatically using this Code


protected void grid1_RowDataBound(object sender, gridviewRowDataBound e)
{
 if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Label lblno = (Label)e.Row.FindControl("lblSerialNo");
                lblno.Text = ((grdMyIdea.PageIndex * grdMyIdea.PageSize) + e.Row.RowIndex + 1).ToString();
            }
}

No comments:

Post a Comment