Hello Experts,
I am working on Gridview , which has operations like insert , update , delete and edit operation, every operation is working fine when table data exist , and binding properly, when there is no data in the table, its not showing any thing except, no records found. but i want to insert new row through gridview for empty data source, please suggest me regarding this. if any body having sample code, please send me.
Thanks
Ram.
Loading
Ish BandhuRank #1,415 · 1.2K reputationPosted Jun 14, 2011, 2:40 AM EDT
Suthish NairRank #92 · 22.8K reputationPosted Jun 14, 2011, 2:56 AM EDT
{
DataTable dt = new DataTable();
dt.Columns.Add("Name", typeof(string));
dt.Rows.Add("Test");
gv.DataSource = dt;
gv.DataBind();
dt = null;
}
Ish BandhuRank #1,415 · 1.2K reputationPosted Jun 14, 2011, 3:31 AM EDT
DataTable dt=new DataTable();
dt.Rows.Add(dt.NewRow);
gridview.DataSource=dt;
gridview.DataBind();
int count=gridview.columns.count;
gridview.Rows[0].Clear();
gridview.Rows[0].Cells.Add(new TableCell());
gridview.Rows[0].Cells[0].ColumnSpan = count;
gridview.Rows[0].Cells[0].Text="No Data Found."
Abhimanyu K VatsaRank #14 · 51.7K reputationPosted Jun 14, 2011, 4:04 AM EDT
More here
hope this helps
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts