This is a migrated thread and some comments may be shown as answers.

17px Difference when setting the Client Side Width

1 Answer 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nabeel
Top achievements
Rank 1
Nabeel asked on 11 May 2011, 11:21 AM
When i set the grid's width not to occupy 100% of the space, i follow your mentioned code as follows

if

 

(actualOffsetWidth < l_screenWidth) {

 

 

sender.MasterTableView._element.style.width =

"";

 

sender.get_element().style.width = sender.MasterTableView._element.offsetWidth +

"px";

 

}

This works fine when I dont have vertical scrollbars. But when I get vertical scrollbars i get 17px difference. See the attached screen.

2) When we have vertical scroll bars it also automatically introduces horizontal scrollbars. I dont know why... i dont need that to be shown. See attachements.

see the difference in header and column lines and also see the unwanted horizontal scrollbar.

your immediate reply is requested.

Thanks very much

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 16 May 2011, 09:23 AM
Hi Nabeel,

The behavior you observe is a browser issue which is due to the way IE7 handles html element's scrollbars - the vertical scrollbar takes part of the width of the element. If the content of the element takes 100% the appearance of a vertical scrollbar as a result of a longer content leads to the appearance of a horizontal one because the total width becomes more than 100%. Therefore, in order to support this browser, you would need to check whether currently there is a vertical scrollbar and if so, decrease the offset width by 17px.
How to determine whether element has scrollbar 

Kind regards,
Tsvetina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Nabeel
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or