Click here to Skip to main content
14,978,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I hava table with 100 record and i want to show only top 10 result in grid view.

i don't want to enable paging.
Updated 26-Nov-10 3:57am

If you are getting data from a database,
maybe you can limit results in select command:

SQL Server: Select Top 10 * From Table

MySql: Select * from Table Limit 10

I hope it is useful.

My site: Oferta imobiliária em Guarulhos

What silvioyf said is correct.
There is another way:
Impllement RowDataBound event on your grid and write the following code:

if (e.Row.RowIndex>10) return;

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