Datagrid newbie question

N

Neo

Hey all,

I'm dynamically creating X number of datagrids based on entries in a
database (1 per client type thing... data is from different databases).

The question is...

I've created 6 boundcolumns (dynamically) to hold the data in each datagrid.
Is there a way to set the width (individually) for each column? I've
searched the internet until I'm blue in the face and keep going in circles.

Example:

datagrid1
20% 50% 25% 5%
---------------------------------------------
|name | address | city | state |
---------------------------------------------
all data here...

Each additional datagrid would have the same column widths. This is just an
example. I would adjust accordingly.

Any help greatly appreciated.

Neo
 
E

Eliyahu Goldin

Neo,

You can specify column width in column properties or in a stylesheet, but it
is not going to help much since all browsers consider your column width
instructions as recommendations. The will arrange columns as they want and
not as you want. Event if you apply the same styles to different grids, the
column width will be different depending on column content.

If you want to put several grids vertically one after another on the same
page and you want the grids to have the same column width, you can consider
having just one grid populated from one merged table that will look like
several grids. This is rather a complicated solution, because you will have
to care about simulating separate headers and inserting other elements
between "virtual grids". Much easier is just to put up with different column
width.

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,780
Messages
2,569,608
Members
45,244
Latest member
cryptotaxsoftware12

Latest Threads

Top