Monday, April 09, 2012

Better Way to Set Web Part Height

We've had customers ask us the best way to set the height of our IntelliGantt Web Part for SharePoint, which at first we thought was kind of odd as every SharePoint web part supports height and width adjustment as part of its Appearance. However, we quickly noticed that a Silverlight web part behaves differently. For example, if you set a specific height, then you get an unnecessary vertical scroll bar that is quite hackneyed. Worse yet, if you used the vertical scroll bar you noticed the specified height of the web part was duplicated with empty space as you scrolled down. This is due to a CSS style sheet being used (overflow:auto) that you cannot unset (ie. overflow:hidden).

So after a bit of experimentation we decided to introduce another way- our own 'Pixel Height' field so that behavior matches expectations. What you will want to do is set the 'Appearance' height to 'No, adjust height to fit in zone'. Then, in our 'IntelliGantt' category, you can specify the height in pixels you prefer. With this, we can explicitly tell SharePoint the height to use for the web part-- and no vertical scroll bar. For example:

2 comments:

sarah lee said...

I really enjoyed reading your article. I found this as an informative and interesting post, so i think it is very useful and knowledgeable. I would like to thank you for the effort you have made in writing this article.


edupdf.org

lee woo said...

Love it! Very interesting topics, I hope the incoming comments and suggestion are equally positive. Thank you for sharing this information that is actually helpful.


ufgop.org
ufgop.orgOur greatest glory is not in never falling, but in

rising every time we fall. See the link below for more info.


#falling
www.ufgop.org