//search route by id protected void SearchRoute(object sender, EventArgs e) { DataTable searchTBL = RouteDAO.GetDataRouteByID(txtSearch.Text.Trim()); if (searchTBL.Rows.Count > 0) { GridView1.DataSource = searchTBL; GridView1.DataBind(); } else { searchTBL.Rows.Add(searchTBL.NewRow()); GridView1.DataSource = searchTBL; GridView1.DataBind(); int columncount = GridView1.Rows[0].Cells.Count; GridView1.Rows[0].Cells.Clear(); GridView1.Rows[0].Cells.Add(new TableCell()); GridView1.Rows[0].Cells[0].ColumnSpan = columncount; GridView1.Rows[0].Cells[0].Text = "No Records Found"; } }