Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top