I have a textbox inside the gridview. While I press enter in button click I need to display a text"New item" in textbox inside the gridview. Here is my code.
protected void Button16_Click1(object sender, EventArgs e)
{
Control control = null;
if (GridView1.FooterRow != null)
{
control = GridView1.FooterRow;
}
else
{
control = GridView1.Controls[0].Controls[0];
}
string Code = (control.FindControl("txtcode") as TextBox).Text;Code="New item"// This I need to display.
}
txcode is the textbox which is inside the gridview. While I press button,the txtcode will display "new item".