Ramco Ramco

Ramco Ramco

  • 442
  • 3.4k
  • 528.5k

Not Showing as Textbox

May 20 2023 9:46 AM

Hi

  I have below code but column is not showing textbox

 grdPlanning.DataSource = dt;
                    int columnIndex = dt.Columns.Count - 1; // Index of the Remarks column

                    foreach (GridViewRow row in grdPlanning.Rows)
                    {
                        TableCell cell = new TableCell();
                        TextBox txtColumn = new TextBox();
                        txtColumn.ID = "txtSessionDate";
                        txtColumn.Text = ((TextBox)row.Cells[columnIndex].Controls[0]).Text;
                        cell.Controls.Add(txtColumn);
                        row.Cells.Add(cell);
                    }
                    grdPlanning.DataBind();

Thanks


Answers (1)