As the title says my grid extends past the screen width....here is my Grid:
When the grid loads with data it stretches past the screen width. What I want it to do is add a scroll bar to the bottom of the grid and allow you to scroll left or right without going off the right side of the screen. Kind of like how you can scroll up and down within the grid with the side scroll bar....that works as inteded.
I also set the initial size of my columns programmatically in the ColumnCreated event:
Any help is appreciated.
thanks,
Coty
<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Sunset" AllowSorting="true" ShowFooter="false"> |
<ItemStyle Font-Size="11px" /> |
<MasterTableView> |
<RowIndicatorColumn> |
<HeaderStyle Width="20px"></HeaderStyle> |
</RowIndicatorColumn> |
<ExpandCollapseColumn> |
<HeaderStyle Width="20px"></HeaderStyle> |
</ExpandCollapseColumn> |
</MasterTableView> |
<ClientSettings AllowColumnHide="false"> |
<Scrolling AllowScroll="true" UseStaticHeaders="True" ScrollHeight="450px" /> |
<Resizing AllowColumnResize="true" ClipCellContentOnResize="true" |
/> |
</ClientSettings> |
</telerik:RadGrid> |
I also set the initial size of my columns programmatically in the ColumnCreated event:
Protected Sub RadGrid1_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles RadGrid1.ColumnCreated |
Dim name As String = e.Column.UniqueName |
'resize columns |
If name = "Name" Or name = "Address1" Or name = "RFI Email" Or name = "Personal Email" Or name = "Practice" Then |
Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn) |
boundColumn.ItemStyle.Width = 150 |
boundColumn.HeaderStyle.Width = 150 |
End If |
If name = "Initials" Or name = "State" Then |
Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn) |
boundColumn.ItemStyle.Width = 45 |
boundColumn.HeaderStyle.Width = 45 |
End If |
If name = "Office" Then |
Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn) |
boundColumn.ItemStyle.Width = 80 |
boundColumn.HeaderStyle.Width = 80 |
End If |
If name = "Ext" Or name = "Zip" Then |
Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn) |
boundColumn.ItemStyle.Width = 50 |
boundColumn.HeaderStyle.Width = 50 |
End If |
If name = "Cell" Or name = "Home" Or name = "Fax" Or name = "Business" Or name = "City" Then |
Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn) |
boundColumn.ItemStyle.Width = 89 |
boundColumn.HeaderStyle.Width = 89 |
End If |
If name = "Address2" Then |
Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn) |
boundColumn.ItemStyle.Width = 70 |
boundColumn.HeaderStyle.Width = 70 |
End If |
If name = "Preferred" Then |
Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn) |
boundColumn.ItemStyle.Width = 95 |
boundColumn.HeaderStyle.Width = 95 |
End If |
End Sub |
Any help is appreciated.
thanks,
Coty