Hi all,
I have an app in which I need to change a gridview column width on the fly, depending on other actions the user has taken. These actions are not known ahead of time.
I have been trying variations of width settings, but nothing seems to work. The text values in the column average about 15 characters, and this seems to force the column to stay to a width that displays the text. Code:
GridView_Instruments.Columns(2).HeaderText = ""
GridView_Instruments.Columns(2).HeaderStyle.Width = UnitType.Pixel
GridView_Instruments.Columns(2).ItemStyle.Width = 1
GridView_Instruments.Columns(2).ItemStyle.Width = UnitType.Pixel
GridView_Instruments.Columns(2).ItemStyle.Width = 1
As you can see I've tried both resizing the header and the column. No luck.
On a side note my real need is just to hide the column - taht works, but when they edit the row, the update bombs since the value in the column is taken as null. Therefore I figured 1 pixel is pretty close to not visible.
Any ideas??
Thanks,
KB
I have an app in which I need to change a gridview column width on the fly, depending on other actions the user has taken. These actions are not known ahead of time.
I have been trying variations of width settings, but nothing seems to work. The text values in the column average about 15 characters, and this seems to force the column to stay to a width that displays the text. Code:
GridView_Instruments.Columns(2).HeaderText = ""
GridView_Instruments.Columns(2).HeaderStyle.Width = UnitType.Pixel
GridView_Instruments.Columns(2).ItemStyle.Width = 1
GridView_Instruments.Columns(2).ItemStyle.Width = UnitType.Pixel
GridView_Instruments.Columns(2).ItemStyle.Width = 1
As you can see I've tried both resizing the header and the column. No luck.
On a side note my real need is just to hide the column - taht works, but when they edit the row, the update bombs since the value in the column is taken as null. Therefore I figured 1 pixel is pretty close to not visible.
Any ideas??
Thanks,
KB