Solved

adding serial number column to datagrid

Posted on 2004-09-07
3
337 Views
Last Modified: 2008-03-03
hi

   I have a datagrid on a page. I want to add a serial no. column automatically to datagrid where the serial number count

depends on the total records in the datagrid.

anybody help me

thanks
sandeep
0
Comment
Question by:sandeep437
3 Comments
 
LVL 4

Accepted Solution

by:
mrdilliard earned 50 total points
ID: 12002156
Add this template column as the first column in your datagrid.
<asp:TemplateColumn>
  <ItemTemplate>
    <asp:Label id="lblCount" Runat="server"><%# GetCount() %></asp:Label>
  </ItemTemplate>
</asp:TemplateColumn>

add this to your code:
      Function GetCount() As Integer
            count = count + 1
            Return count
      End Function

Have fun!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question