Fixing Column Widths Permanently

D

DarthMcAdam

I have a datagrid that I'm using to show a list of hierarchical data,
much like a tree-view. I won't go into the detail, suffice to say that
the reason I'm doing this is because of the poor quality of the data
(imported from a legacy system) and the manner in which the database
has had to be designed to accommodate this; in no way is it ideal, but
we have no other options but to do it this way.

Anyhoo, when I expand each level (columns going left-to-right), I'm
finding that if the text in the next column is wider than the
column-width that has been set, it expands to some degree to
accommodate the text.

Does anyone know how I can possibly fix the widths to prevent them from
widening/narrowing so that the surrounding columns don't 'shift' from
right-to-left and back again?

Just so you know, I've set the following values:
ItemStyle-Width
HeaderStyle-Width
ItemStyle-CssClass (width defined in the class)

I've also tried setting text-overflow: ellipsis, but it didn't do
anything! A shame, since that would have been perfect. I've had
moderate success with Style.Add("WORD-BREAK", "break-all"), but it's
still not perfect and in any case, the results are not great.

Any help on this would be appreciated.
 
E

Elton Wang

One way to workaround is to trim text to fixed length and the assign whole
text to ToolTip of the cell.

HTH
 

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,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top