Click here to Skip to main content
15,844,155 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using Datagrid view with LinQDataSource
Now i have do Auto increment function for a FIRST column and every cells at every Rows Added event

I found this solutions and works for me

<asp:TemplateField HeaderText="S.No." ItemStyle-HorizontalAlign="Center">
<![CDATA[<%#(Container.DataItemIndex + 1) + ((YourGridViewID.PageIndex) * (YourGridViewID.PageSize))%>]]>
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900