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

[Solved] No-Wrap in Grid Columns.

4 Answers 145 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.
Tarun
Top achievements
Rank 1
Tarun asked on 17 May 2011, 01:38 PM
Hi,
I am using Telerik Grid for my application. I want to have a feature in which the columns of a grid should not auto Wrap itself and if the content of Column increases the column width, they should be clipped and shown with ellipses. What is the best way to achieve this?

I was able to achieve this by using Css properties :
So for my column i have added below attributes:
  .HtmlAttributes(new {  @style = "overflow: hidden; white-space: nowrap; text-overflow: ellipses;" });
And added Scrollable attribute to my Grid:
    .Scrollable(s => s.Enabled(true).Height("auto"))
Now I am getting the desired behaviour but with that i am getting a vertical Scroll bar which i Don't want.
Is there a way by which I can hide the vertical scrollbar? It is disabled currently but i want to hide it.

Or is there a better way to implement this functionality?
Thanks In Advance.



4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 17 May 2011, 05:24 PM
Hi Tarun,

Please refer to

http://www.telerik.com/community/forums/aspnet-mvc/grid/show-ellipsis-when-cell-content-is-larger-than-the-specified-width.aspx

Greetings,
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
0
Tarun
Top achievements
Rank 1
answered on 18 May 2011, 11:16 AM
Hi,
I already tried this solution but it doesn't solve my problem. If I give only the CSS style which you  have provided the Grid column resizes itself to fit the content in single line even if i have given the column width. But if I give Scrollable attribute with this CSS , it works fine but it give the Scrollbar functionality also which i dont want. Can you tell me a way by which I can hide the vertical scroll bar which is coming?
thanks
tarun
0
Accepted
Dimo
Telerik team
answered on 18 May 2011, 04:06 PM
Hello Tarun,

If you are not using Grid scrolling, then you should also add a fixed table-layout style:

.t-grid  table
{
    table-layout: fixed ;
}

You can do the  same via the TableHtmlAttributes setting of the component.

Best wishes,
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
0
Tarun
Top achievements
Rank 1
answered on 19 May 2011, 12:37 PM
thanks a lot, it worked.
Tags
Grid
Asked by
Tarun
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Tarun
Top achievements
Rank 1
Share this question
or