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

Scroll button only visible after window resizing

1 Answer 133 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Jose Simas
Top achievements
Rank 2
Jose Simas asked on 28 May 2010, 11:03 AM
Hi,

I came across this scenario that appears to be a bug. When I bind a series of items to a RadTabControl that is not wide enough to show them the scroll buttons do not appear until I resize the window. This is the simplest way to duplicate:

XAML:

<Window x:Class="Workbench.RadTabControlTest"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" Title="RadTabControlTest" Height="400" Width="500">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        
        <Button 
            Width="125"
            Height="25"
            Click="Button_Click">Set Items</Button>
        
        <Controls:RadTabControl 
            x:Name="tabs"
            Width="250"
            Height="150"
            Grid.Row="1"
            />
    </Grid>
</Window>

And the code behind:

public partial class RadTabControlTest: Window
    {
        public RadTabControlTest()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            tabs.ItemsSource = new[] {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"};
        }
    }

I am using the latest release and the project is .NET 4.0.

Am I doing something wrong?

Cheers,
Jose

1 Answer, 1 is accepted

Sort by
0
Bobi
Telerik team
answered on 02 Jun 2010, 11:42 AM
Hi Jose Simas,

All you need to do is to use the following code:
private void Button_Click(object sender, RoutedEventArgs e)
        {
            tabs.ItemsSource = new[] { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten" };
            tabs.UpdateLayout();
        }
I  hope that this will help you. Please let us know if you have any other questions or need some more help.

All the best,
Bobi
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.
Tags
TabControl
Asked by
Jose Simas
Top achievements
Rank 2
Answers by
Bobi
Telerik team
Share this question
or