Click here to Skip to main content
15,922,309 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,

here is the scenario

i have a dataset which contains 100 records but i want to show 50 rows only in gridview. i dont want to use paging . i want my gridview in fixced size of 50

please do reply.
thanks in advance
Posted

1 solution

One way you could try is to set the Row's visible to false if its index is greater than 50:
C#
void gridView1_RowCreated(Object sender, GridViewRowEventArgs e)
{
   if(gridView1.Rows.Count > 50)
   {
      e.Row.Visible = false;
   }
}
 
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