View Single Post
  #1 (permalink)  
Old May 24th, 2006, 04:05 AM
GertFrost GertFrost is offline
Registered User
 
Join Date: May 2006
Location: Copenhagen, , Denmark.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataGrid renders different on different machines

Hi

I'm working on a .NET application and has run into an annoying problem.

I have a report, that consists of a DataGrid, wher I have disabled the AutoGenerateColumns, as I'm binding the columns myself.

I have turned on nowrap on "Header" and "Item", and is explicit setting width (bcol.ItemStyle.Width = Unit.Pixel(270); )

the problem is, that on my own machine and the "production"-server, the HTML renders differently, so the "<table>" does not respect the width I have set.

This is the data for the 2 machines:

mine:
XP Professional version 2002 sp2
MSIE 6.0.2900.2180.xpsp_sp2_gdr.050301-1519
ASP .Net (v2.0.50727).

the other:
XP Professional version 2002 sp2
MSIE 6.0.2900.2180.xpsp_sp2_gdr.050301-1519
ASP .Net (v2.0.50727).

regardless of the "identicality" of the two machines, the resulting HTML is as follows:

my machine:
...
<table>
<tr>
   <td nowrap="nowrap" align="left" style="font-weight:bold;width:270px;"></td>
</tr>
</table>
...

and the other:
...
<table>
<tr>
   <td align="left" style="font-weight:bold;width:270px;white-space:nowrap;"></td>
</tr>
</table>
...

Note, that the "nowrap" is different. As far as I can tell, the style-attribute on the "other" machine is invalidating the <td>-tag, and thus the table does not respect the "width"-setting.

Can anyone explain why this is? Where is the difference between the two machines? And even better - how can I get the other machine to render the HTML like my own machine?

Thanks in advance