GridView中显示行号

<asp:TemplateField HeaderText="行号">
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%#Container.DataItemIndex+1 %>'></asp:Label>
                            </ItemTemplate>
</asp:TemplateField>

你可能感兴趣的:(GridView)