Hi
I have written below code in Gridview . I want to set Dafault value = "".
When i write this - e.Row.Cells[e.Row.Cells.Count - 1].Text = ""; it make it as readable
TextBox txtDate = new TextBox();
txtDate.CssClass = "form-control";
txtDate.DataBind();
e.Row.Cells[e.Row.Cells.Count - 1].Controls.Add(txtDate);
Thanks
Tuhin PaulPosted May 5, 2023, 9:04 AM
To set the default value of the `TextBox` control to an empty string ("") in the `GridView`, you can use the `Text` property of the `TextBox` control. You can set the `Text` property of the `TextBox` control to an empty string in the `RowDataBound` event handler of the `GridView`. In this example, the `Text` property of the `TextBox` control is set to an empty string in the `RowDataBound` event handler. This will set the default value of the `TextBox` control to an empty string for each row in the `GridView`.