controlling panel width from code

D

dba56

I have a panel containing textboxes and buttons which I use as a
header for a datagrid on a webform. I would like the panel width to
match the datagrid width. The datagrid width grows depending on the
data being displayed. I tried setting the panel style width to the
datagrid width after the datagrid is bound. But the panel is being set
to the datagrid width I set at design time, not the actual datagrid
width once it has been rendered. I suspect that there may be a way to
do this using Javascript and will experiment. I was just wondering if
anyone has done something like this. Any guidance or advice would be
greatly appreciated.
 
E

Eliyahu Goldin

Don't do this sort of things in javascript. You should align your controls
properly in tables. Put the panel and the datagrid in the same column in an
html table and the browser will do the job for you nicely.

Eliyahu
 
D

dba56

Eliyahu,

It works perfectly. I set the width of the panel and datagrid to 100%,
put them in the same column of a table with one row and they always
align.

Thanks again.

Lou
 

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

Top