编码问题:
将具有控件的 Asp.Net GridView 转换回数据表
现实世界的问题:
谷歌没有我能找到并实施的任何真正有用的答案
Asp.Net 网格视图:
<asp:GridView ID="gvCompanies" runat="server" AutoGenerateColumns="False" AllowSorting="True" OnSorting="gridView_Sorting">
<Columns>
<asp:TemplateField HeaderText = "Comapny Id"><ItemTemplate><%# Eval("Company Id")%></ItemTemplate></asp:TemplateField>
<asp:TemplateField HeaderText = "New Company Id"><ItemTemplate><asp:TextBox ID="TextBox5" runat ="server"></asp:TextBox></ItemTemplate></asp:TemplateField>
<asp:TemplateField HeaderText = "Company Name"><ItemTemplate><asp:TextBox ID="TextBox6" runat ="server"></asp:TextBox></ItemTemplate></asp:TemplateField>
<asp:TemplateField HeaderText = "Branch Id"><ItemTemplate><asp:TextBox ID="TextBox7" runat ="server"></asp:TextBox></ItemTemplate></asp:TemplateField>
<asp:TemplateField HeaderText = "Location Id"><ItemTemplate><asp:TextBox ID="TextBox8" runat ="server"></asp:TextBox></ItemTemplate></asp:TemplateField>
<asp:TemplateField HeaderText = "Location Name"><ItemTemplate><asp:TextBox ID="TextBox9" runat ="server"></asp:TextBox></ItemTemplate></asp:TemplateField>
<asp:TemplateField HeaderText = "Prefix"><ItemTemplate><asp:TextBox ID="TextBox10" runat ="server" ></asp:TextBox></ItemTemplate></asp:TemplateField>
<asp:TemplateField HeaderText = "Sort"><ItemTemplate><asp:TextBox ID="TextBox11" runat ="server"></asp:TextBox></ItemTemplate></asp:TemplateField>
<asp:TemplateField HeaderText = "Cash In Transit"><ItemTemplate><asp:TextBox ID="TextBox12" runat ="server"></asp:TextBox></ItemTemplate></asp:TemplateField>
<asp:TemplateField HeaderText = "Cash Sub In Transit"><ItemTemplate><asp:TextBox ID="TextBox13" runat ="server"></asp:TextBox></ItemTemplate></asp:TemplateField>
<asp:TemplateField HeaderText = "Cash Account"><ItemTemplate><asp:TextBox ID="TextBox14" runat ="server"></asp:TextBox></ItemTemplate></asp:TemplateField>
<asp:TemplateField HeaderText = "Cash Sub Account"><ItemTemplate><asp:TextBox ID="TextBox15" runat ="server"></asp:TextBox></ItemTemplate></asp:TemplateField>
<asp:TemplateField HeaderText = "Payment Method"><ItemTemplate><asp:TextBox ID="TextBox16" runat ="server"></asp:TextBox></ItemTemplate></asp:TemplateField>
<asp:TemplateField HeaderText = "AppDB"><ItemTemplate><%# Eval("AppDB")%></ItemTemplate></asp:TemplateField>
</Columns>
</asp:GridView