PDA

Click to See Complete Forum and Search --> : paging & set number of datagrid rows


alex_read
Sep 11th, 2003, 07:45 AM
If you use paging with the datagrid control, you've got the option to set the max number of rows to display on the grid at a single time.

My question is, how can I set a minimum value?? i.e. the first time the grid gets displayed, 10 rows are on the first page & the grid will display on my webform with, say, a height of 100px. When the user clicks to view the second page, only 6 more records are returned only resulting in 6 rows in the grid making it's height drop to 60px.

I'd like if possible to have my grid stay showing 10 rows (whether some are blank or not) on each page so it's height stays the same. Anyone know if there's a way to do this please??

Thanks :cool:

cim3
Sep 11th, 2003, 09:57 AM
I ended up keeping a count of the rows and if there was less than the max amount it moved into a sub to add blank rows to the datagrid.

alex_read
Sep 11th, 2003, 10:05 AM
Cheers cim3,

I spotted there was a datagrid & column height property on the net as well this morning which I might also try, I guess that will just make the bottom row expand though & could look a little dodgy, but I'm going to give both ways a try. :)

Lethal
Sep 11th, 2003, 10:12 AM
Another solution would be to embed your grid within a html table and give it a fixed height.