Gridview does not binding Values.
Hi friends,i m developing attendance percentage module for student..herewith i have developed the grid view to bind the percentage manually...i have written the code but it goes not bind..can anyone correct my code...here with i had attached the sample...
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Sanjeeb LenkaRank #301 · 8.3K reputationPosted Oct 7, 2013, 10:41 PM EDT
public void gvbind()
{
if (Session["Tab"] == null)
{
DataTable table = new DataTable();
table.Columns.Add("Tatalworkingdays");
table.Columns.Add("Present");
table.Columns.Add("Absent");
table.Columns.Add("Percentage");
DataRow Dr = table.NewRow();
Dr["Tatalworkingdays"] = Label16.Text;
Dr["Present"] = Label17.Text;
Dr["Absent"] = Label18.Text;
Dr["Percentage"] = Label19.Text;
table.Rows.Add(Dr);
this.GridView1.DataSource = table;
GridView1.DataBind();
}
else
{
this.GridView1.DataSource = Session["Tab"] as DataTable;
GridView1.DataBind();
}
}
selva kumarRank #2,987 · 483 reputationPosted Oct 7, 2013, 10:47 PM EDT