limit colunm width in gridview
I've come across a few solutions on the forum for this problem but it
still don't work :(
I have a column that can contains very long text value. I was hoping
the value would be truncated to the size of the column's width. So I
did the following :
Protected Sub grdCuttings_RowCreated(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.GridViewRowEventArgs) Handles
Dim iWidth As Integer = 100
If e.Row.RowType = DataControlRowType.DataRow Then
For r As Integer = 0 To Me.grdCuttings.Columns.Count - 1
Me.grdCuttings.Columns(r).ItemStyle.Width = iWidth
Me.grdCuttings.Columns(r).ItemStyle.Wrap = False
It changes the width but the text is wrapped instead of being
Can you help ?
Re: limit colunm width in gridview
Um... you can't really... actually that's not true.
You can specify a number of characters to place in the field, but your
users may have different font settings to you, and their text will wrap
You can try setting the no-wrap CSS attribute on your cells and
specifying overflow: hidden; but I don't know how well that will work.
It's not the sort of thing you tend to do very often on a webpage.
|All times are GMT. The time now is 06:29 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.