摘要:GridView Bind Datasource and textbox to edit 批次存檔
<asp:GridView ID="gv" runat="server"
AllowSorting="True" AutoGenerateColumns="False" BackColor="#CCFFFF"
BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" CellPadding="4"
DataSourceID="ds1" HorizontalAlign="center"
Caption='<table border="1" width="100%" cellpadding="0" cellspacing="0" bgcolor="#006699">
<tr><td><font color=white><span id="h" runat="Server" >文具申請單</span> </font></td></tr></table>'
CaptionAlign="Top">
<PagerSettings Position="TopAndBottom" />
<RowStyle BackColor="#CCFFFF" ForeColor="blue" HorizontalAlign="Right" />
<PagerStyle BackColor="#006699" ForeColor="White" HorizontalAlign="Left" />
AllowSorting="True" AutoGenerateColumns="False" BackColor="#CCFFFF"
BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" CellPadding="4"
DataSourceID="ds1" HorizontalAlign="center"
Caption='<table border="1" width="100%" cellpadding="0" cellspacing="0" bgcolor="#006699">
<tr><td><font color=white><span id="h" runat="Server" >文具申請單</span> </font></td></tr></table>'
CaptionAlign="Top">
<PagerSettings Position="TopAndBottom" />
<RowStyle BackColor="#CCFFFF" ForeColor="blue" HorizontalAlign="Right" />
<PagerStyle BackColor="#006699" ForeColor="White" HorizontalAlign="Left" />
row from 2 start
but if add <PagerSettings
row from 3 start
Dim h = "gv:_ctl"
Dim ah = 3
For row As Integer = 0 To gv.Rows.Count - 1
txtName = h & (row + ah).ToString() & ":tb0"
valGv(row, 0) = form1.FindControl(txtName).Text
....
next