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

Provide kendo grid column header wrap around for long column title so that the column width will stayed fix

5 Answers 907 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Parthasarathi
Top achievements
Rank 1
Parthasarathi asked on 10 Dec 2012, 01:56 PM
Hi All,

How to wrap large data in row column preventing extending column width?
Please help in this case as soon as possible. It would be appreciated.

Regards,
Partha.

5 Answers, 1 is accepted

Sort by
-1
Marcin Butlak
Top achievements
Rank 2
answered on 10 Dec 2012, 02:22 PM
You can give explicit width to any column in the grid. Just use the width parameter in column definition.
0
Parthasarathi
Top achievements
Rank 1
answered on 12 Dec 2012, 06:32 AM
Hi Marcin,

We have already tried in the same way. But no luck. Is there any other way?

Regards,
Partha.
0
Marcin Butlak
Top achievements
Rank 2
answered on 12 Dec 2012, 02:33 PM
Ok I see the problem even if you set the width the text doesn't wrap if it is not fitting in the column. The problem lies in column header styles.

You must either override the global column header styles:
.k-grid-header .k-header {
   overflow: visible;
   white-space: normal;
}
or apply them to every column via headerAtrributes: http://docs.kendoui.com/api/web/grid#columnsheaderattributes-object.
0
John
Top achievements
Rank 1
answered on 29 May 2013, 02:30 AM
Through kendo tag

<kendo:grid-column headerAttributes="style=\"overflow: visible; white-space: normal;\"" title="your title" field="fieldName" />

Thanks for the info.
0
David McClelland
Top achievements
Rank 1
answered on 25 Nov 2013, 02:51 PM

Yes, this was helpful to me too!  If you're using the ASP.NET MVC wrappers, you can do this:

columns.Bound(p => p.Active).Title("Active").HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
Tags
Grid
Asked by
Parthasarathi
Top achievements
Rank 1
Answers by
Marcin Butlak
Top achievements
Rank 2
Parthasarathi
Top achievements
Rank 1
John
Top achievements
Rank 1
David McClelland
Top achievements
Rank 1
Share this question
or