Solved

adding serial number column to datagrid

Posted on 2004-09-07
3
321 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

759 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now