Solved

adding serial number column to datagrid

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
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 …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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