Ramco Ramco

Ramco Ramco

  • 445
  • 3.4k
  • 530.3k

Value is shown in column  

May 5 2023 4:32 AM

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)