473,324 Members | 2,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Line Numbering In DataGrid

23
Hey everyone...I'm trying to figure out how to create a template column in a datagrid to automatically display the line number of the data.

EX:

Search Results

1 Bla
2 Bla2
3 Bla3
4 Bla4
5 Bla5

I dont mind if the line numbers restart if paging is implemented and the user clicks onto the next page in the datagrid.

Thanks in advance!!
Dec 22 '06 #1
2 1260
karthi84
271 100+
hi,
can u tell from where the data grid is populated. i.e., the data source and which language u r using i.e., c# or vb.net
Dec 29 '06 #2
gderosa
23
Thanks for your help I actually found the code..here it is if others need it:

Expand|Select|Wrap|Line Numbers
  1. <asp:TemplateColumn><ItemTemplate>
  2. <%#MyDataGrid.PageSize * MyDataGrid.CurrentPageIndex + Container.ItemIndex + 1
  3. %>
  4. </ItemTemplate>
  5. </asp:TemplateColumn>
Jan 2 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

48
by: David J Patrick | last post by:
I'm trying to rewrite the CSS used in http://s92415866.onlinehome.us/files/ScreenplayCSSv2.html. using the w3.org paged media standards as described at http://www.w3.org/TR/REC-CSS2/page.html ...
0
by: stingray | last post by:
Hi I just used Visual C++ to compile a C code. I code a bunch of error messages (mostly syntax errors) How to get to these errors? Is there any automatic line numbering feature that I can use ...
2
by: buran | last post by:
Dear ASP.NET Programmers, I am using the datagrid control (grdSPs) to display database data. The datagrid allows paging. What I am trying to do is to insert row numbers automatically. I can...
1
by: Tim Newton | last post by:
Hi Anyone tell me how to number the rowheaders of a datagrid, e.g. 1,2,3,4,5 etc, just like in excel. I could put the row numbers in a new column but there has to be a simple way of adding it to...
0
by: Juan Romero | last post by:
Hey guys, Does anyone out there have a good method to do line numbering in a richtextbox control? This seemed simple at first glance, but It has proven to be a tough task. I want to create a...
3
by: Jim Bancroft | last post by:
Hi all, In VB6 I used a 3rd party tool for line numbering my source code, to help with debugging. However, in experimenting with VB .Net I've noticed that my exceptions automatically provide...
2
by: Jitdor | last post by:
Sorry for this rather naive question... Does anyone know of a way to enable vertical sequential line numbering in the code editor window? I've tried various settings in VC# and googling but...
0
by: saraDotNet | last post by:
Hi, I'v Two Questions: 1-Is there a way to make an auto numbering avalible in vb.net form textbox as the one in Access db columns when we set the datatype as autonumbering?? 2- I'm working on a...
2
by: =?Utf-8?B?R3VzIENodWNo?= | last post by:
I can’t find the line numbering on/off in the option box. Am I missing something? Can any one help me. I’m using visual studio C# 2005 express edition thank You Gus
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.