J
Jeremy
I have googled for this issue, and many other people have the same problem
with no resolution. The data grid column sizes automatically resize based
on their contents no matter what the Style.Width is set to. I was looking
at the HTML output, and the values I entered for Width does not even get
generated.
And to make things worse, even though I set the width of the Grid to 100%,
it actually expands beyond the edge of the screen forcing the user to scroll
horizontally. Here is my code:
Private Sub AddTemplateColumn( _
ByVal InsertAt As Integer, _
ByVal itemTemplate As ITemplate, _
ByVal headerText As String, _
ByVal pixelWidth As Integer)
Dim tempColumn As New TemplateColumn
dgOptions.Columns.AddAt(InsertAt, tempColumn)
With tempColumn
.ItemTemplate = itemTemplate
.HeaderText = headerText
.ItemStyle.Width = _
New Web.UI.WebControls.Unit( _
pixelWidth, _
UnitType.Pixel)
End With
End Sub
This is driving me insane.
Thanks,
Jeremy
with no resolution. The data grid column sizes automatically resize based
on their contents no matter what the Style.Width is set to. I was looking
at the HTML output, and the values I entered for Width does not even get
generated.
And to make things worse, even though I set the width of the Grid to 100%,
it actually expands beyond the edge of the screen forcing the user to scroll
horizontally. Here is my code:
Private Sub AddTemplateColumn( _
ByVal InsertAt As Integer, _
ByVal itemTemplate As ITemplate, _
ByVal headerText As String, _
ByVal pixelWidth As Integer)
Dim tempColumn As New TemplateColumn
dgOptions.Columns.AddAt(InsertAt, tempColumn)
With tempColumn
.ItemTemplate = itemTemplate
.HeaderText = headerText
.ItemStyle.Width = _
New Web.UI.WebControls.Unit( _
pixelWidth, _
UnitType.Pixel)
End With
End Sub
This is driving me insane.
Thanks,
Jeremy