I have a datagrid with TemplateDataField and I have specified a Width of 20px on it. It contains an asp:Image. This works fine with Internet Explorer. However, in Google Chrome the column appear very small, showing only part of the icon in it.
On looking at the source the two browsers produce, I see that in IE it creates a <td> with a style having width of 20px. In Google Chrome the <td> has no style! and probably that is why it ignores the width and column appears smaller.
It would be really helpful if someone can suggest a way to resolve this annoying little problem.
Tahir
Any suggestions?
Hello,
I tested this in the latest version of Google Chrome (8.0.552.224) and setting a width on the template column, <ig:TemplateDataField Key="TemplateField_0" Width="200px">, caused the TD for the header to have the width of 200px (in both IE & Chrome). Also setting the width on the image was picked up in both Internet Explorer and Chrome.
Please retest in the latest version of chrome. If you are still having an issue, please provide me more information on how your Grid is configured so that I may be of more assistance.
Thanks,
Valerie
Let me know if you have any other questions on this matter.
The css classes in Offics2007Silver include padding: 5px 8px 5px 8px which adds padding around the image. It appears that Chrome fails to process padding-left/right in order to adjust overall size of its TD while IE does.
In theory the overall width of the TD should be equal to width + padding + border width, but Chrome uses only the width and keeps it at 20px.
You can work around this by either setting a larger width for the column than the image or removing the padding in the ig_dataGrid.css file.
Please let me know if you have any questions.
Thank you for the sample. I see your issue and I am looking into a resolution.
Thank you for your reply. Please find attached a sample I have created with the problem.