datagrid rowheight

B

Bull

Hi

Is it possible to set the rowheight of the datagrid.

I have a paging grid but if there is say 2 entries then the height of each
row expands to fill the height of the grid.

I want a way to keep the rowheight constant so leaving empty space at the
bottom.

Kind Regards
 
E

Eliyahu Goldin

Don't fix the height of the grid. Rather put it into a container, say a
<div> element, and make the grid background color the same as the
container's one. The grid will size itself and won't change the rowheight
and the empty space below the grid will look as the grid's background
although it actually belongs to the container.

Eliyahu
 
E

Eliyahu Goldin

Here is an example with using stylesheets. Note, that you don't have to
specify the grid's background color. It will inherit one from the container.

<head>
....
<style type="text/css">
..CellForGrid{vertical-align:top;height:[the height you
want];background-color:[the color you want]}
..Grid{width:100%}
</style>
....
</head>
<body>
....
<div class="CellForGrid">
<asp:DataGrid ... CssClass="Grid" ...>
....
</asp:DataGrid>
</div>
....
</body>

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

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,196
Latest member
TopCryptoTxSoftwares2024

Latest Threads

Top