Hi...
In .aspx:
<asp:TemplateField HeaderText="Quantity" HeaderStyle-Width="40px" >
<ItemTemplate>
<asp:Label ID="lblq" runat="server" Text='<%# bind("Quantity") %>' ></asp:Label></ItemTemplate>
<HeaderStyle Width="40px"></HeaderStyle>
<EditItemTemplate><asp:TextBox ID="txteq" runat="server" Text='<%# bind("Quantity") %>'></asp:TextBox></EditItemTemplate>
<FooterTemplate ><asp:TextBox ID="txtq" runat="server" ForeColor="Blue" Width="40px"></asp:TextBox></FooterTemplate>
</asp:TemplateField>
For rowediting(aspx.cs):
protected void gv_RowEditing(object sender, GridViewEditEventArgs e)
{
gv.EditIndex = e.NewEditIndex;
getdata();
}
In rowupdating(aspx.cs):
string QUAT = ((TextBox)gv.Rows[e.RowIndex].FindControl("txteq")).Text;
int quat = Convert.ToInt32(QUAT.Trim());
and then write ur query for updating in .cs.
thanks,its may useful to u.