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

grid with autogenerated columns having horizontal and vertical scrollbars not visible

1 Answer 136 Views
This is a migrated thread and some comments may be shown as answers.
kk luwang
Top achievements
Rank 1
kk luwang asked on 12 Jul 2010, 01:04 PM

I've a grid with autogenerated columns (columns are dynamic) and i'm setting the width of the 1st column in itemdatabound event.
And I'm using IE 8, so even if i've given the code for freezing the 1st column and header of the grid when it is scrolled horizontal or vertical, the horizontal or vertical scrollbars are not visible at all but when i click on Compatibility view icon near the refresh icon in web page, then only the grid becomes visible. How can i resolve this issue?  I don't want the user to click on ' Compatibility view '
 icon every time. And besides the grid moves when the number of columns are more. How can i resolve this?


<telerik:RadGrid ID="DR_Low_RadGrid" runat="server" AllowPaging="false" AllowSorting="True"



AutoGenerateColumns="true" GridLines="None" PageSize="14" Width="900px" Skin="Office2007"



OnNeedDataSource="DR_Low_RadGrid_NeedDataSource" OnItemDataBound="DR_Low_RadGrid_ItemDataBound"






<GroupingSettings CaseSensitive="false" />



<AlternatingItemStyle Font-Names="verdana" Font-Size="10px" />



<ItemStyle Font-Names="verdana" Font-Size="10px" HorizontalAlign="Left" />



<HeaderStyle Font-Bold="true" Font-Names="Verdana" Font-Size="10px" ForeColor="Black"



HorizontalAlign="Center" />



<MasterTableView AutoGenerateColumns="true" DataKeyNames="Geography" Width="899px"



NoMasterRecordsText="No low case data found." NoDetailRecordsText="No low case data found."



PagerStyle-EnableSEOPaging="false" PagerStyle-Mode="Slider">



<PagerStyle EnableSEOPaging="false" Mode="Slider" />









<Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" FrozenColumnsCount="1"



EnableVirtualScrollPaging="false" />






<PagerStyle Mode="NumericPages" />





1 Answer, 1 is accepted

Sort by
Telerik team
answered on 15 Jul 2010, 07:50 AM
Hello kk luwang,

If your RadGrid has a Width of 900px and the MasterTableView has a Width of 899px, then it is normal to not see a horizontal scrollbar (or see a small one). This will be the case even if there is no Width for the MasterTableView, because if you set at least one column width while using static headers, the MasterTableView's TableLayout is switched to "FIxed". In this case the columns shrink to fit inside the RadGrid width.

Finally, you should not set Width to the MasterTableView at all when using frozen columns, because this will create a side effect - when scrolling to the right, remaining visible columns expand.

In your case you should set explicit widths to all columns (fixed layout) or do not set width to any column (auto layout). Generally, applying column settings in ItemDataBound is not correct - apply them in ColumnCreated for autogenerated columns and declaratively/programmatically for non-autogenerated columns.

Best wishes,
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Asked by
kk luwang
Top achievements
Rank 1
Answers by
Telerik team
Share this question