I found ASP.Net was throwing in a style=”display:inline-block” on some of my elements. This style element works fine in IE – but was hosing up the display of content in Chrome and FireFox. Turns out that ASP.Net automatically injects that style element anytime you set the width or height on an ASP.Net control.
Easy and recommended fix: remove the height and width being set on the control and instead use a CSS style to assign the dimensions.
Complicated fix: over-ride the render method on the control.
Thanks for this. I couldn't understand why I was getting the 'display: inline-block' inserted into the HTML displaying a Grid control :)
ReplyDeleteWhen did this start to happen?
ReplyDeleteThere is no such problem before.
alternatively you can try this:
ReplyDeletecontrol.Style.Add("width", "45");