protected void GridViewVPR_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { RequisitionRecord record = (RequisitionRecord)e.Row.DataItem; int ReuestID = record.RequestID; Label LblDateProcessed = e.Row.FindControl("LblDateProcessed") as Label; if (record.ApprovedDate != null) { LblDateProcessed.Text = ((DateTime)record.ApprovedDate).ToString("d"); } else { LblDateProcessed.Text = "null"; } RequisitionRecord re = (RequisitionRecord)e.Row.DataItem; int RequestID1 = re.RequestID; Label LblStatus = e.Row.FindControl("LblStatus") as Label; string status = RequisitionLogic.GetRecordStatus(re.RequestID); if (status != null) { LblStatus.Text = status; } } }