Fixed Column Widths in DataGrid

A

Alex Maghen

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?

Alex
 
K

Ken Cox [Microsoft MVP]

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]
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top