Adding column widths

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to set the width of the grid to the total widths of the column

I have been trying to add columns by doing thi
..Columns(2).Width + .Columns(2).Widt
But I get this message
Operator '+' is not defined for types 'System.Web.UI.WebControls.Unit' and 'System.Web.UI.WebControls.Unit'

If I try and convert the Columns widths by doing this Convert.ToInt32(.Columns(1).Width) and then addin ghtem all up I get an error
Specified cast is not valid

..Width = Unit.Pixel(Convert.ToInt32(.Columns(1).Width) + Convert.ToInt32(.Columns(2).Width) + Convert.ToInt32(.Columns(3).Width) + Convert.ToInt32(.Columns(4).Width)

Does anyone have any sugesstions

Thank
 
* "=?Utf-8?B?SmVmZg==?= said:
I am trying to set the width of the grid to the total widths of the columns

I have been trying to add columns by doing this
.Columns(2).Width + .Columns(2).Width
But I get this message:
Operator '+' is not defined for types 'System.Web.UI.WebControls.Unit' and 'System.Web.UI.WebControls.Unit'.

If I try and convert the Columns widths by doing this Convert.ToInt32(.Columns(1).Width) and then addin ghtem all up I get an error:
Specified cast is not valid.

.Width = Unit.Pixel(Convert.ToInt32(.Columns(1).Width) + Convert.ToInt32(.Columns(2).Width) + Convert.ToInt32(.Columns(3).Width) + Convert.ToInt32(.Columns(4).Width))

Use 'Width.Value' instead of 'Width'.
 
Back
Top