<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
onrowdatabound="GridView1_RowDataBound" >
<Columns>
<asp:TemplateField HeaderText="First">
<ItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Second">
<ItemTemplate>
<asp:DropDownList ID="ddl_BindValues" DataValueField="Name" runat="server">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Third">
<ItemTemplate>
<asp:TextBox ID="TextBox2" Text='<%#Eval("id") %>' runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fourth">
<ItemTemplate>
<asp:TextBox ID="TextBox3" Text='<%#Eval("name") %>' runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fifth">
<ItemTemplate>
<asp:TextBox ID="TextBox4" Text='<%#Eval("Price") %>' runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowEditButton="True" HeaderText="Edit" />
</Columns>
</asp:GridView>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindGrid()
}
}
public void BindGrid()
{
Con = new SqlConnection("Connection string")
Con.Open()
dt = new SqlDataAdapter("Select * from Your Table ", Con)
DataSet ds = new DataSet()
dt.Fill(ds)
GridView1.DataSource = ds
GridView1.DataBind()
Con.Close()
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
TextBox txt1 = (TextBox)e.Row.FindControl("TextBox1")
txt1.Text = DateTime.Now.ToString()
}
}
<big>I hope now you can solve that</big></i>