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

RadPanelBar resizing TextBox

2 Answers 89 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tom
Top achievements
Rank 1
Tom asked on 07 Feb 2012, 02:56 PM

<UserControl ...>
<telerik:RadPanelBar>
    <telerik:RadPanelBarItem Header="Hello" IsExpanded="True">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="70"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="70"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <sdk:Label Grid.Column="0" Content="Label1" />
            <TextBox Grid.Column="1" Text="foo" BorderThickness="1" BorderBrush="Black" Height="20"  />
            <sdk:Label Grid.Column="2" Content="Label2" />
            <TextBox Grid.Column="3" Text="foo" BorderThickness="1" BorderBrush="Black" Height="20"  />
        </Grid>
    </telerik:RadPanelBarItem>
</telerik:RadPanelBar>


In a RadPanelBar my textboxes will resize according to the text I put into them.

If I write "fooooooooooooooooooooooooooooooooooooooooooooooo" the text box will resize (same if I set a ColumnDefinition = "auto" instead of "*").

I don't want this and can't find out how change RadPanelBar template (or something) to remove this auto-resizing behavior.

Thank you!

2 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 10 Feb 2012, 01:44 PM
Hi Tom,

You can disable the internal RadPanelBar horizontal ScrollBar in order to get over this issue:
<telerik:RadPanelBar ScrollViewer.HorizontalScrollBarVisibility="Disabled">
    <telerik:RadPanelBarItem Header="Hello"
                                IsExpanded="True">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="70"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="70"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <sdk:Label Grid.Column="0"
                        Content="Label1" />
            <TextBox Grid.Column="1"
                        Text="foo"
                        BorderThickness="1"
                        BorderBrush="Black"
                        Height="20" />
            <sdk:Label Grid.Column="2"
                        Content="Label2" />
            <TextBox Grid.Column="3"
                        Text="foo"
                        BorderThickness="1"
                        BorderBrush="Black"
                        Height="20" />
        </Grid>
    </telerik:RadPanelBarItem>
</telerik:RadPanelBar>

Please give this a try and let me know if it helps or if we can further assist you.

Kind regards,
Tina Stancheva
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Tom
Top achievements
Rank 1
answered on 14 Feb 2012, 09:14 AM
Yes, it works great!
Thank you.
Tags
PanelBar
Asked by
Tom
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Tom
Top achievements
Rank 1
Share this question
or