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

[Solved] Grid is distorted when entered large data in the field

2 Answers 220 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.
Ravi Keshwani
Top achievements
Rank 1
Ravi Keshwani asked on 07 Jan 2011, 07:05 AM
Hi,

 I am setting grid column width explicity when declaring in the view. But when the contents of the column are more then the width the grid is getting distorted. I tried the same in the sample provided by telerik but the issue also persists in the demo too. pls find the screen shot..

What is expect is the width should remain static and the contents should be wrapped or shown as "contents upto to column width......"  as it was possible in asp.net telerik.

Thanks
Ravi keshwani

2 Answers, 1 is accepted

Sort by
0
shiva
Top achievements
Rank 1
answered on 25 Jan 2011, 03:23 PM
Hello,
 this is one of the major problems faced by everybody and if telerik could provide some fix for it would be great!

0
Dimo
Telerik team
answered on 25 Jan 2011, 04:02 PM
Hello,

The observed problem is caused by a combination of two default browser behaviors:

1. table cells normally expand to enclose all their content, unless you set table-layout:fixed style to the Grid table. After that the content, which does not fit in the horizontal space and cannot be wrapped, will be clipped.

Html.Telerik().Grid().TableHtmlAttributes(new {style = "table-layout:fixed"})


2. browser normally do not split long words or numbers, unless you use an additional CSS rule:

.t-grid  td
{
      word-break:break-all;
}

However, note that the above style is not supported by all browsers.


An alternative way to prevent issues with long words is to enable Grid scrolling:

Html.Telerik().Grid().Scrollable(scrolling => scrolling.Enabled(true))

http://demos.telerik.com/aspnet-mvc/grid?theme=vista


Kind regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Ravi Keshwani
Top achievements
Rank 1
Answers by
shiva
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or