Hi Guest 1 HomePage 1 Jobs 1 WalkIn 1Articles  

 :) Latest Topic
AJAX
VB.NET
SQL Query
UDDI
CLASS
JAVASCRIPT
SharePoint Interview
SilverLight
WCF
general knowledge
 ASP.NET
 :) Hot Jobs
 :) Latest Articles
 


  

 
add auto increment field to gridview
Classified Posted on 12 Jul 2011

Home >> DotNet >> ASP.NET >> add auto increment field to gridview



First add a bound column to GridView at position 0 in databound field and addevent RowDataBound to the GridView

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
  {
   if (e.Row.RowType == DataControlRowType.DataRow)
  {
   e.Row.Cells[0].Text =Convert.ToInt32(e.Row.RowIndex+1).ToString();
  }
}


Other Important Questions
Colour coding in ListBox
Void Function return value with out parameter
What is Substitution control in asp.net 4.0
How to stop the clientside validation of an entire page
get session variable value in html page







 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |