RadPanelBar resizing TextBox

3 posts, 0 answers
  1. Tom
    Tom avatar
    2 posts
    Member since:
    Feb 2012

    Posted 07 Feb 2012 Link to this post


    <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. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 10 Feb 2012 Link to this post

    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 >>
  3. DevCraft banner
  4. Tom
    Tom avatar
    2 posts
    Member since:
    Feb 2012

    Posted 14 Feb 2012 Link to this post

    Yes, it works great!
    Thank you.
Back to Top