5
Answers

Value is shown in column  

Ramco Ramco

Ramco Ramco

1y
416
1

Hi

  I have below Gridview. In below line it shows value  . Last column is Date. It should be either space or Date

gr.Cells[gr.Cells.Count - 1]

SQLUtility sQLUtility = new SQLUtility();
                DataTable dt = sQLUtility.GeBookPlanningRecommendation(HRpl, BookCollection, StudentCollection).Tables[0];
                if (dt != null)
                {
                    DataColumn Remarks = new DataColumn("Remarks", typeof(string));
                    dt.Columns.Add(Remarks);
                    DataColumn Dates = new DataColumn("Date", typeof(DateTime));
                    dt.Columns.Add(Dates);
}
}

*******************************
foreach (GridViewRow gr in grdPlanning.Rows)
                {
                    //string sessionDate = "";
                    if (gr.RowType == DataControlRowType.DataRow)
                    {
                        if (gr.Cells[gr.Cells.Count - 1].Text != "")
                        {
}
}
}

Thanks

Answers (5)