<asp:templatefield HeaderText="处理人">
<headerstyle horizontalalign="Left" />
<itemstyle width="38%" HorizontalAlign="left" />
<ItemTemplate>
<asp:TextBox ID="DealMan" runat="server" CssClass="InputCss0" Text='<%#Eval("vPosno") %>'></asp:TextBox> </ItemTemplate>
</asp:templatefield>
如何取行索引??
<headerstyle horizontalalign="Left" />
<itemstyle width="38%" HorizontalAlign="left" />
<ItemTemplate>
<asp:TextBox ID="DealMan" runat="server" CssClass="InputCss0" Text='<%#Eval("vPosno") %>'></asp:TextBox> </ItemTemplate>
</asp:templatefield>
如何取行索引??
CommandArgs='<%#((GridViewRow)Container).RowIndex%>'protected void GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
if (e.CommandName == "AddToCart")
{
int index = Convert.ToInt32(e.CommandArgument);
}
}
<ItemTemplate>
<asp:Button ID="AddButton" runat="server"
CommandName="AddToCart"
CommandArgument="<%#((GridViewRow) Container).RowIndex%>"
Text="Add to Cart" />
</ItemTemplate>
</asp:TemplateField>