Sizing the dataGrid

C

CDX

I have a dataGrid on a form, In design mode it behaves as I would expect
when resizing the form. However when I populate it when running, it no
longer resizes the same way. Seems like when the # of rows changes, it
tries to resize to fit the number of rows.


I'd like to to stay next to the border on the top, left and right, but a
specific number of pixels from the bottom, no matter how it is resized.

Thanks,
Chip
 
E

Eliyahu Goldin

Chip,

Likely, the grid tries to resize because you've set it's height explicitly.
Don't do this and the grid will take exact space it needs to render all the
rows in their natural height. Now, to fill up the bottom, place the grid
inside a panel with the same color as the grid's background. For the panel
you can safely specify the height you wish. For the user the grid and the
panel will look like just one grid.

Eliyahu
 
C

CDX

Eliyahu,
I see the Size option in properties, but what do I do to not set the
height explicitly? I tried 0,0 but that doesn't seem right.

Chip
 
E

Eliyahu Goldin

Chip,

What is your platform? Here we are talking about asp.net grid. It doesn't
have Size property, rather Height and Weight. You are probably talking about
Windows.Form one.

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top