protected void bindGrid() { ListToDataTable lsttodt = new ListToDataTable(); var lst = _service.GetBatchList(); DataTable dt = lsttodt.ToDataTable(lst); if (dt != null && dt.Rows.Count > 0) { grd.DataSource = dt; grd.DataBind(); } else { grd.DataBind(); } }