"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Saturday, May 15, 2010

AutoNumber Column or Auto Number in GridView or DataList ASP.NET

 Hi,
I posted early adding Serial Number on datagrid and that was through itemdatabound sometimes it may cause ur pjt to run a bit slow.on client-side Serial Number a nice concept is it...

Here v Go...


<asp:GridView ID="GridView1" runat="server"
              AllowPaging="True" AutoGenerateColumns="False">
    <Columns>
    <asp:TemplateField HeaderText="Serial Number">
    <ItemTemplate>
        <%# Container.DataItemIndex + 1 %>
    </ItemTemplate>
    </asp:TemplateField>
    <asp:BoundField DataField="Name" HeaderText="Name"/>
    </Columns>
    </asp:GridView>


I hope this will help u....
Have a nice day... 'N happy Coding :)

ASP.NET Data Web Controls Kick StartProfessional DevExpress ASP.NET Controls (Wrox Programmer to Programmer)

No comments: