Articles   Dev Forums   Personalize   Favorites   Member Login        Active Users:  168
DevASP - ASP and XML Articles, Samples, Toturials, Sample Chapters and resources for Developers Sunday, July 06, 2008
Home
Articles & Samples
Dev Search
Dev Forum
Add a Listing
Sample Chapters
Directory Feed
Link to US
Contact

Search Directory
Applications
Articles & Samples
Components
Community
Database
Developer Sites
Downloads
Hosting Services
Introduction
Knowledge Base
Sample Chapters
WebCasts

Trusted by over 7 million customers!
ASP Directory
Applications
Articles & Samples
Components
Developer Sites
Knowledge Base
Sample Chapters
WebCasts
XML Directory
Applications
Articles & Samples
Developer Sites
Error, Bugs & Fixes
Downloads
Introduction
Knowledge Base
Sample Chapters
WebCasts

FREE 12 month online training for ASP.NET & MS Expression Studio and a Free copy of MS Expression Web with Windows Server Purchase

Home > Search > Developers Training > ASP.NET
ASP.NET: Code Snippet - DataGrid with line numbers       
Total Hits: 306  |  Today: 0 Author: Rey Nuñez       Rating:  
Read Reviews | Write Review |              Your Rating: 

In this article, we will look at a technique that will allow us to generate row numbers in the first column of a DataGrid. To generate the row numbers, we will use the DataGridItem's ItemIndex property. Nikhil Kothari (ASP.NET team member extraordinaire) was kind enough to inform me that the ItemIndex property was created for just such a scenario. As such, the sample below is very simple. We will create an extra TemplateColumn in our DataGrid and bind to it the value of Container.ItemIndex. The ItemIndex property is zero based so we will add one to it and voila, we have a row counter in our DataGrid.

What's New at DevASP
03/22  ASP.NET AJAX Control Development
03/22  ASP.NET AJAX meets Virtual Earth ..
03/22  ASP.NET AJAX meets Virtual Earth ..
02/22  Building AJAX scroller control us..
02/22  Dirty Panel Extender (ASP.NET AJA..
02/22  A Stoppable Timer Control for ASP..
02/22  flickr Spell Extender Control for..
02/22  AJAX AutoComplete/AutoSuggest Tex..
02/22  AJAX Multi-Task Indicator
02/22  Professional file uploads with th..
02/22  An Ajax image list control to man..
02/22  An information box control to dis..
02/22  MultiUpload, a smarter file uploa..
02/22  Grid Live Refresh
02/22  ASP.NET AJAX Extender for multico..
02/22  Integrating AJAX
02/22  Troubleshooting Partial Rendering..
02/22  Ajaxion - Ajax without javascript..
02/22  ASP.NET Validation using Ajax
02/22  Using Associative Arrays for Clie..
Latest Posts at Dev Forums
I wanna create a log file
Method to automatically delete a datab..
example of editing in DataGrid and Def..
flash+combobox+access
Any Free HTML to PDF converter library..
Any Free HTML to PDF converter library..
mod_rewrite
online leave system
Error at CDONTS.NewMail
ASp.net https problem with firefox
CDONTS NewMail Object
How to reduce the processing time of S..
searching and paging
RegExp Problem
Transparent Encryption
Transparent Encryption
text search within dynamic file
Commit and Rollback in ASP with JAVASC..
how to build db for using in listboxes..
asp and xml packets

DevASP - Privacy - Disclaimer
Copyright © 2008 DevASP.com