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

no wrap for mvc grid

2 Answers 214 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Muhamad Tassadaque Zia
Top achievements
Rank 1
Muhamad Tassadaque Zia asked on 18 Jun 2010, 10:54 AM
Hi

how can nowrap property for grid can be set. i don't want my text in a cell to wrap around if it exceeds the height specified

Regards
Tassadaque

2 Answers, 1 is accepted

Sort by
0
Accepted
Harvey
Top achievements
Rank 1
answered on 23 Jul 2010, 04:49 AM
This worked for me...

columns.Bound(c => c.Description).Width(200).HtmlAttributes(new {style = "overflow: hidden; white-space: nowrap; text-overflow: ellipsis;"});
0
Bernhard
Top achievements
Rank 1
answered on 06 Mar 2013, 09:06 AM
Another option would be to provide a client or header template that wraps your content in a DIV that has the style set to not wrap contents like the following:

.HeaderTemplate("<div style='overflow-x:scroll;white-space:nowrap;'>Your content goes here.</div>")
Tags
Grid
Asked by
Muhamad Tassadaque Zia
Top achievements
Rank 1
Answers by
Harvey
Top achievements
Rank 1
Bernhard
Top achievements
Rank 1
Share this question
or