Hi all..
Please help me out with code-behind coding ..
I have a method -
private void BindGridView()
{
Datatable table ;
Gridview grdv ;
table = new Datatable();
grdv = new GridView();
if(table != null)
{
grdv . datasource = table;
grdv.databind();
Here -
I want the following -
How to do this is code - behind ?? Please guide !!
}
}
My Requirement is - I have to do nothing on aspx page.
I have to do all in code-behind - Default.aspx.cs page.
Please help..its a bit urgent... Thanks in advance !!

Yadlapalli SrikanthRank #7,940 · 231 reputationPosted Sep 16, 2015, 3:37 AM EDT
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lbl= (Label)e.Row.FindControl("lbl");
lbl.Text = (e.Row.RowIndex+1).ToString();
}
}
Riddhi ValechaRank #794 · 2.9K reputationPosted Sep 16, 2015, 4:00 AM EDT
Yadlapalli SrikanthRank #7,940 · 231 reputationPosted Sep 17, 2015, 1:11 AM EDT
grd1.RowDataBound+= new GridViewRowEventHandler(grd1_RowDataBound);