Hello, i created some user control and it has telerik grid inside. Problem is with scrollbars - they dont appear automaticaly. even when grid has many columns. See my attached image.
My tabControl, of which content is this user control:
Method, which fills tabItem content:
How to make the grid to get scrollbars automatically in all dimensions, depending on the data and tab item measurements..?
My user control:
<UserControl x:Class="XSoftArt.WPFengine.BaseClasses.ListTemplate" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
> |
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> |
<Menu Name="menu1" Height="54" VerticalAlignment="Top" Background="AliceBlue"> |
<MenuItem Name="MenuItemReports" Background="AliceBlue" Click="MenuItemReports_Click"> |
<MenuItem.Header> |
<StackPanel> |
<Image Width="32" Height="32" Source="/XSoftArt.WPFengine;component/Images/reports.png" /> |
<ContentPresenter Content="Reports" /> |
</StackPanel> |
</MenuItem.Header> |
</MenuItem> |
<MenuItem Name="MenuItemExport" Background="AliceBlue" Click="MenuItemExport_Click"> |
<MenuItem.Header> |
<StackPanel> |
<Image Width="32" Height="32" Source="/XSoftArt.WPFengine;component/Images/export32x32xp.png" /> |
<ContentPresenter Content="Export" /> |
</StackPanel> |
</MenuItem.Header> |
</MenuItem> |
<MenuItem Name="MenuItemNewRecord" Background="AliceBlue" Click="MenuItemNewRecord_Click"> |
<MenuItem.Header> |
<StackPanel> |
<Image Width="32" Height="32" Source="/XSoftArt.WPFengine;component/Images/new32.png" /> |
<ContentPresenter Content="New record" /> |
</StackPanel> |
</MenuItem.Header> |
</MenuItem> |
<MenuItem Name="MenuItemEditRecord" Background="AliceBlue" Click="MenuItemEditRecord_Click"> |
<MenuItem.Header> |
<StackPanel> |
<Image Width="32" Height="32" Source="/XSoftArt.WPFengine;component/Images/edit32.png" /> |
<ContentPresenter Content="Edit record" /> |
</StackPanel> |
</MenuItem.Header> |
</MenuItem> |
<MenuItem Name="MenuItemDeleteRecord" Background="AliceBlue" Click="MenuItemDeleteRecord_Click"> |
<MenuItem.Header> |
<StackPanel> |
<Image Width="32" Height="32" Source="/XSoftArt.WPFengine;component/Images/delete32.png" /> |
<ContentPresenter Content="Delete record" /> |
</StackPanel> |
</MenuItem.Header> |
</MenuItem> |
<MenuItem Name="MenuItemSettings" Background="AliceBlue" Click="MenuItemSettings_Click"> |
<MenuItem.Header> |
<StackPanel> |
<Image Width="32" Height="32" Source="/XSoftArt.WPFengine;component/Images/settings32.png" /> |
<ContentPresenter Content="Settings" /> |
</StackPanel> |
</MenuItem.Header> |
</MenuItem> |
<MenuItem Name="MenuItemRecordHistory" Background="AliceBlue" Click="MenuItemRecordHistory_Click"> |
<MenuItem.Header> |
<StackPanel> |
<Image Width="32" Height="32" Source="/XSoftArt.WPFengine;component/Images/histrory32x32xp.png" /> |
<ContentPresenter Content="Record history" /> |
</StackPanel> |
</MenuItem.Header> |
</MenuItem> |
<MenuItem Name="MenuItemClose" Background="AliceBlue" Click="MenuItemClose_Click"> |
<MenuItem.Header> |
<StackPanel> |
<Image Width="32" Height="32" Source="/XSoftArt.WPFengine;component/Images/uzdaryti programa.png" /> |
<ContentPresenter Content="Close window" /> |
</StackPanel> |
</MenuItem.Header> |
</MenuItem> |
</Menu> |
<Grid Margin="0,54,0,0" Name="grid1" Height="43" VerticalAlignment="Top" Background="AliceBlue"></Grid> |
<Grid Margin="0,96,0,0" Name="grid2" Height="36" VerticalAlignment="Top" Background="AliceBlue"> |
<Label HorizontalAlignment="Left" Margin="5,7,0,-5" Name="label1" Width="85.223">Record count:</Label> |
<Label HorizontalAlignment="Left" Margin="85,7,0,4" Name="labelRecordCount" Width="57">0</Label> |
<dxe:CheckEdit HorizontalAlignment="Left" Margin="124,7,0,7" Name="checkEdit1" Width="72" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" Checked="checkEdit1_Checked" Unchecked="checkEdit1_Unchecked">Select all</dxe:CheckEdit> |
<Button Click="buttonDeleteSelected_Click" Background="AliceBlue" BorderThickness="2" HorizontalAlignment="Left" Margin="202,7,0,4" Name="buttonDeleteSelected" Width="89.183" FontSize="9">Delete selected</Button> |
<Label HorizontalAlignment="Right" Margin="0,4,6,4" Name="labelSelectTime" Width="122" FlowDirection="RightToLeft">0</Label> |
<Button HorizontalAlignment="Left" Margin="296.81,7,0,6" Background="AliceBlue" BorderThickness="2" Click="buttonSaveColumnLayout_Click" Name="buttonSaveColumnLayout" Width="125.743">Save column layout</Button> |
</Grid> |
<StackPanel Margin="0,58,149,0" Name="stackPanel1" Width="32" Height="32" HorizontalAlignment="Right" VerticalAlignment="Top"> |
<Button Name="Button_ReloadData" Click="Button_ReloadData_Click" Background="AliceBlue" > |
<Image Source="/XSoftArt.WPFengine;component/Images/reload32.png"></Image> |
</Button> |
</StackPanel> |
<telerik:GridViewDataControl HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="dataGridView1" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Margin="1.425,134,0,0" /> |
</Grid> |
</UserControl> |
<telerik:RadTabControl Margin="0,91,0,-2.896" x:Name="tabControlR" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> |
RadTabItem tabItem = new RadTabItem(); |
ListTemplate lst = new ListTemplate(); |
lst.tabWindow = tabItem; |
tabItem.Content = lst; |
tabItem.Header = "Paieskos langas II"; |
tabItem.Name = "tabPaieskosTestas"; |
tabControlR.Items.Add(tabItem); |