Results 1 to 4 of 4

Thread: paging & set number of datagrid rows

  1. #1

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    paging & set number of datagrid rows

    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

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  2. #2
    Addicted Member
    Join Date
    Mar 2001
    Location
    Devon, UK
    Posts
    181
    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.
    Wind and waves resolves all problems.

  3. #3

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    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.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  4. #4
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Another solution would be to embed your grid within a html table and give it a fixed height.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width