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
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