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

Prevent wrapp

4 Answers 17 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
Veteran
Iron
David asked on 22 Oct 2014, 02:06 PM
I am trying to prevent wrapping of too long columns to the second line.
I was able to do it by cutting size of the

Protected Sub AllGrids_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs)

        Dim intMaxLength As Integer = 60

        Dim grd As RadGrid = CType(sender, RadGrid)

        If (TypeOf e.Item Is GridDataItem) Then

            Dim gridItem As GridDataItem = CType(e.Item, GridDataItem)

            gridItem("Description").ToolTip = gridItem("Description").Text

            If gridItem("Description").Text.Length > intMaxLength Then
                gridItem("Description").Text = gridItem("Description").Text.Substring(0, intMaxLength) + "..."
            End If

        End If

    End Sub

In addition i have to do some manipulation on export to export full size field.

There are gotta be a better way though, right?

4 Answers, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
Veteran
Iron
answered on 23 Oct 2014, 05:21 PM
Anybody? I assume it is pretty common case
0
Eyup
Telerik team
answered on 27 Oct 2014, 11:22 AM
Hello David,

Generally, you can use the approach demonstrated in the following article to achieve the requested functionality:
http://www.telerik.com/help/aspnet-ajax/grid-gridcolumn-resizetofit.html

Hope this helps.

Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
David
Top achievements
Rank 1
Veteran
Iron
answered on 27 Oct 2014, 12:31 PM
Hi Eyup,

  I don't need to resize column. I want data to fit inside column similar to pic attached. Ideally i want toolltip to show full data, and when i export i need full field to be exported
0
Eyup
Telerik team
answered on 30 Oct 2014, 12:21 PM
Hi David,

You can use the approach demonstrated in the following post to achieve this requirement:
http://www.telerik.com/forums/how-to-wrap-the-text-without-space-in-a-rad-grid-column#vsYxAljFzE2YZ4W8EqCdZg

That should do the trick. Please give it a try and let me know if it works for you.

Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
David
Top achievements
Rank 1
Veteran
Iron
Answers by
David
Top achievements
Rank 1
Veteran
Iron
Eyup
Telerik team
Share this question
or