Click here to Skip to main content
15,909,091 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi frens, i need a small help.
I have a task to export the datas of gridview to excel but the condition is that i need to export only the first page datas of the gridview. How can i do that? the gridview has page size 50 but the datas may vary and how can i export like sometimes 40 or sometimes 50 or may be 5 only sometimes...
please reply
Posted

Solution for ASP.NET
You can calculate it, using GridView.AllowPaging[^] and GridView.Rows.Count[^] properties.
 
Share this answer
 
You can use
datagrid.Rows.count
to know how many rows datagrid have?
Then you can select a row with use index of that.like this
datagrid.Rows[index]
 
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