M
Mad Scientist Jr
I have a datagrid that has a column that I would like to be the widest
(say 60%) - however another column is populated with some data that is
sometimes a rather long string, and it expands to take up most of the
table width. I tried to force the column sizes to force the longer
column to wrap but it isn't working. Any help appreciated, my code is
below:
DataGrid1.DataSource = DataTable1
DataGrid1.DataBind()
DataGrid1.Columns(0).ItemStyle.Width = Unit.Percentage(10)
DataGrid1.Columns(1).ItemStyle.Width = Unit.Percentage(60)
' this column is getting squashed
DataGrid1.Columns(2).ItemStyle.Width = Unit.Percentage(10)
' this column still ends up taking 70% or so
DataGrid1.Columns(3).ItemStyle.Width = Unit.Percentage(10)
(say 60%) - however another column is populated with some data that is
sometimes a rather long string, and it expands to take up most of the
table width. I tried to force the column sizes to force the longer
column to wrap but it isn't working. Any help appreciated, my code is
below:
DataGrid1.DataSource = DataTable1
DataGrid1.DataBind()
DataGrid1.Columns(0).ItemStyle.Width = Unit.Percentage(10)
DataGrid1.Columns(1).ItemStyle.Width = Unit.Percentage(60)
' this column is getting squashed
DataGrid1.Columns(2).ItemStyle.Width = Unit.Percentage(10)
' this column still ends up taking 70% or so
DataGrid1.Columns(3).ItemStyle.Width = Unit.Percentage(10)