Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
From database "name" i should bind in textbox of gridview .... whats the code for this
Posted
Updated 22-Dec-12 18:36pm
v2

1 solution

XML
<asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound">
 <Columns>
  <asp:TemplateField HeaderText="TextBox">
   <ItemTemplate>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
   </ItemTemplate>
  </asp:TemplateField>

aspx.cs file:
C#
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
 if ( e.Row.RowType == DataControlRowType.DataRow )
 {
  TextBox textBox1 = (TextBox)e.Row.FindControl("TextBox1");
}
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900