all groups > asp.net webcontrols > december 2004 >
You're in the

asp.net webcontrols

group:

Fixed Column Widths in DataGrid


Fixed Column Widths in DataGrid Alex Maghen
12/30/2004 9:29:02 AM
asp.net webcontrols: Hi. Is there a way to configure a DataBound column (or any other column) in a
DataGrid control so that, no matter what, it will not be wider than a certain
number of pixels? My problem is that with some unicode text, IE can't find a
line break so it doesn't wrap the text, it just streaches out the width of
the column. I need it to just cut the text off in those circumstances.

Ideas?

Re: Fixed Column Widths in DataGrid Ken Cox [Microsoft MVP]
12/30/2004 7:22:55 PM
Hi Alex,

I suspect that you're up against a limitation of HTML.

Your best bet would be to test the content of the column when the grid item
is bound and then trim the text to an acceptable length. You should be able
to do this in the ItemDataBound event.

Ken
MVP [ASP.NET]

[quoted text, click to view]
AddThis Social Bookmark Button