protected void FillGridData() { DataView dv = new DataView(); dv.Table = clsobj.GetScheduledAppointments(); if (strSortExpression != "" && strSortDirection != "") { dv.Sort = strSortExpression + " " + strSortDirection; } if (dv.Count > 0) { grdAppointments.DataSource = dv; grdAppointments.DataBind(); } else { grdAppointments.DataSource = dv; grdAppointments.DataBind(); alertMSG.Visible = true; } if (intPageIndex != 0) { grdAppointments.PageIndex = intPageIndex; } }