<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" >
<Columns>
<asp:TemplateField HeaderText="ID" Visible="true">
<ItemTemplate>
<%--<asp:Label ID="rowIndex" runat="server" Text='<%# DataBinder.Eval(Container, "RowIndex") %>'></asp:Label>--%>
<asp:Label ID="rowIndex" runat="server" Text='<%# Container.DataItemIndex%>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="City">
<ItemTemplate>
<asp:Label ID="lblName" runat="server" Text='<%#Eval("City") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
0 comments:
Post a Comment