Did you find any solution yet?

H

Hooman

Hi,

I have the same problem, actually i had two problems:
I wanted to show the row index in my girdview for each row and then i want to show the total records on the top of the page.
The solution for the first problem is ( I am writing to leave a comment for people who are searching) you can place a template field in your gridview and add a lable field inside it and set the text value equal to row index:

<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="rowidx"
text='<%# DataBinder.Eval(Container, "RowIndex") +1 %>' runat="server">
</asp:Label>
</ItemTemplate>
</asp:TemplateField>

by this we can show the row index in gridview in asp.net, but still i couldn't figure our where i can put the label2.text=gridview1.rows.count.tostring value
in the code, any idea?

cheers
Hooman Golparvar

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top