Ramco Ramco

Ramco Ramco

  • 442
  • 3.4k
  • 517.5k

editable column in Gridview

Apr 29 2023 10:29 AM

Hi

In a Gridview there r 5 columns . 1 column is Date which is the last column.

I want to make that column only editatble & user should enter date in dd-mm-yyyy format only otherwise it should give message

I have tried this but it is not making editable

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

    
    grdPlanning.DataSource = BookPlanningResult;
    int lastColumnIndex = BookPlanningResult.Columns.Count - 1;
    BookPlanningResult.Columns[lastColumnIndex].ReadOnly = false;
    BookPlanningResult.Columns[lastColumnIndex-1].ReadOnly = false;
    grdPlanning.DataBind();
}

Thanks

 


Answers (2)