This is a migrated thread and some comments may be shown as answers.

Grid contents not wrapping

2 Answers 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anand S
Top achievements
Rank 1
Anand S asked on 22 Sep 2009, 05:22 PM
Hi,

We are using telerik grid where we display data entered by our users. We  have set fixed column widths and enabled  wrap.

What  happens is if there is a word w/o space it does not wrap,  rather it gets cut while being displayed.

What  is the solution  for this - e.g. any grid tools wraps data automatically 


Thanks 

Anand

2 Answers, 1 is accepted

Sort by
0
Todd Anglin
Top achievements
Rank 2
answered on 23 Sep 2009, 03:35 AM
Hello Anand-

Sorry to hear about your trouble with the long word wrapping. I know that is frustrating!

Unfortunately, this is a "native" behavior of HTML. Long words that do not have any spaces or "break characters" cannot be wrapped. The solutions are either:

A) Before binding your data, "clean" it with code that inserts spaces at specific intervals so it can be property wrapped
B) Let the text "overflow" in to a hidden area (the approach RadGrid provides automatically)

For more discussion on this HTML issue, check out this discussion on Stackoverflow:

Hope that helps!
-Todd
0
Fabio
Top achievements
Rank 1
answered on 02 Apr 2014, 09:12 PM
I got around this problem by using CSS style "word-break:break-all;"

@(Html.Telerik().Grid<
...
columns.Bound(c => c.Name).HtmlAttributes(new { @style = "word-break:break-all;" });
...
Tags
Grid
Asked by
Anand S
Top achievements
Rank 1
Answers by
Todd Anglin
Top achievements
Rank 2
Fabio
Top achievements
Rank 1
Share this question
or