How to remove grid view pagesize?

1k views Asked by At

My gridview shows 10 rows per page, but some rows are too big (some fields are varchar(100)). For example, "Observations" field: Values can be "None" or... a very long text. It makes pages have different heights: some are scrollable and others no.

I wonder if there is a way to ignore/remove the "pagesize" gridview property and make it shows as many rows as possible with a fixed height(no vertical scrollbar).

2

There are 2 answers

0
Karl Anderson On BEST ANSWER

No, you cannot control the amount of rows to grow or shrink based upon the vertical height of the entire grid.

You are better off truncating the values displayed in the grid and then having a view details button in each row or creating a hover effect that displays the full text if the user wishes to view it.

Another possibility is to to have a drop down list with page size values (i.e. 5, 10, 20, 25, 50, etc.) that allows the user to adjust the amount of rows displayed on a page to their liking.

1
netokp On

You can put de gridview inside a div with heigth equals to 100 % and disable de pagesize of the gridview, this give you the layout that you are looking for.