Forums - C# Corner

Forum guidelines
Durga Velusamy

Durga Velusamy

  • 1.2k
  • 245
  • 35.1k

how to get values from asp gridview to code behind to updat

Aug 13 2017 6:38 AM
how to get values from asp gridview to code behind to update.
 
label can get values. but text box value  not gettig.   its getting empty from text box.
 
<asp:GridView ID="grvItemDetails" runat="server"
ShowFooter="True" AutoGenerateColumns="False"
CellPadding="4" ForeColor="#333333"
GridLines="None" OnRowDeleting="grvStudentDetails_RowDeleting">
<Columns>
<asp:BoundField DataField="RowNumber" HeaderText="SNo" />
<asp:BoundField DataField="itemid" HeaderText="Item Id" Visible="true" />
<asp:BoundField HeaderText="Item Name"
DataField="itemname"
SortExpression="itemname"></asp:BoundField>
<%--<asp:TemplateField HeaderText="Item Name">
<ItemTemplate>
<asp:TextBox ID="itemname" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="Weight">
<ItemTemplate>
<asp:TextBox ID="wieght" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Price">
<ItemTemplate>
<asp:TextBox ID="price" runat="server" ></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowDeleteButton="True" />
<%-- <asp:Button ID="ButtonAdd" runat="server"
Text="Add Image " />--%>
<%-- <asp:ImageField HeaderText="Picture">
</asp:ImageField>--%>
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
 

Answers (2)