I find It very annoying when adding row number to a query result, espesially when you're working with different RDMS like Oracle or SQL Server. They have their own syntax for row numbering. But when you use that in a GridView or DataGrid, it will be a piece of cake. You can try using this technique in just like example :
<Columns>
<asp:TemplateColumn HeaderText="No.">
<ItemTemplate>
<asp:Label runat="server" ID="LabelNumber"
Text="<%# Grid1.PageSize*Grid1.currentPageindex + Container.ItemIndex+1%>">
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
Add a new column for your Row number. And you will find Grid1 is the ID of your GridView or DataGrid.
Here's give it a try :)
Life of a programmer full of learning, errors, achievement, and passion. Every code we type is meaningful in our life. Proud to be a programmer.
Thursday, November 29, 2012
Subscribe to:
Posts (Atom)
Finally, C# 9 record, the equivalent of Scala's case class
While C# is a wonderful programming language, there is something that I would like to see to make our life programmer easier. If you are fam...
-
I'm using git as my version control for my unity projects. In my second project, I have problem with vast amount of file changes generat...
-
While C# is a wonderful programming language, there is something that I would like to see to make our life programmer easier. If you are fam...
-
If you are tired of being asked for a password when accessing your remote droplet servers in Digitalocean, you might consider adding an rsa ...