collapse up

5 posts, 1 answers
  1. Zbigniew Kozłowski
    Zbigniew Kozłowski avatar
    60 posts
    Member since:
    Apr 2010

    Posted 20 Apr 2010 Link to this post

    Hi,
    is there a way to collapse panelbar up? Because now its taking 100% of rest height. If i have 2 panelbar items they get 50% of the content, and what i need is, that for example when there are two panelbar items first will get height of his all controls, and second panelbar will get rest. Sorry for mine english i dont know how to explain it ;)

    Regards,
    Zbigniew Kozłowski
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 23 Apr 2010 Link to this post

    Hi Zbigniew Kozłowski,

    You can use the VerticalContentAlignment property of the RadPanelBar and set it to Top for example, then the RadPanelItem's content will be aligned at the top of the available space and the item will take as much space as its content demands.

    Can you take a look at the attached project and let me know if this is what you had in mind?

    Kind regards,
    Tina Stancheva
    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Zbigniew Kozłowski
    Zbigniew Kozłowski avatar
    60 posts
    Member since:
    Apr 2010

    Posted 24 Apr 2010 Link to this post

    Not working for me :( This is mine code:
    <DockPanel Background="#d5d8dc"
            <Grid DockPanel.Dock="Top"
                <Grid.RowDefinitions> 
                    <RowDefinition Height="33" /> 
                </Grid.RowDefinitions> 
                <Grid.ColumnDefinitions> 
                    <ColumnDefinition Width="*"/> 
                    <ColumnDefinition Width="90" /> 
                    <ColumnDefinition Width="90" /> 
                </Grid.ColumnDefinitions> 
     
                <telerik:RadButton KeyboardNavigation.IsTabStop="False" TabIndex="18" Grid.Row="0" Grid.Column="1" telerik:StyleManager.Theme="Vista" Name="cancelButton" Content="Anuluj (ESC)" Height="28" Width="80"></telerik:RadButton> 
                <telerik:RadButton KeyboardNavigation.IsTabStop="False" TabIndex="17" Grid.Row="0" Grid.Column="2" telerik:StyleManager.Theme="Vista" Name="saveButton" Content="Zapisz (F2)" Height="28" Width="80"></telerik:RadButton> 
     
            </Grid> 
     
            <Grid> 
                <telerik:RadPanelBar  telerik:StyleManager.Theme="Vista" VerticalContentAlignment="Top" HorizontalAlignment="Stretch" x:Name="radPanelBar" ExpandMode="Multiple" > 
                    <telerik:RadPanelBarItem IsExpanded="True"
                        <telerik:RadPanelBarItem.Header> 
                            <TextBlock Text="Dane ogólne" Margin="5 4 5 5" FontWeight="Bold" FontSize="14"  /> 
                        </telerik:RadPanelBarItem.Header> 
     
                        <telerik:RadPanelBarItem IsSelected="True"
                            <telerik:RadPanelBarItem.Header> 
                                <StackPanel Orientation="Horizontal" Margin="5"
                                    <Label Width="130" HorizontalContentAlignment="Right" Name="descriptionLabel" Content="Skrót nazwy" /> 
                                    <TextBox KeyboardNavigation.IsTabStop="False" KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.TabIndex="0" Name="descriptionTextBox" Width="300" HorizontalAlignment="Left" /> 
                                </StackPanel> 
                            </telerik:RadPanelBarItem.Header> 
                        </telerik:RadPanelBarItem> 
     
                        <telerik:RadPanelBarItem> 
                            <telerik:RadPanelBarItem.Header> 
                                <StackPanel Orientation="Horizontal" Margin="5"
                                    <Label Width="130" HorizontalContentAlignment="Right" Name="fullDescriptionLabel" Content="Pełna nazwa" /> 
                                    <TextBox KeyboardNavigation.IsTabStop="False" KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.TabIndex="0" Name="fullDescriptionTextBox" Width="300" HorizontalAlignment="Left" /> 
                                </StackPanel> 
                            </telerik:RadPanelBarItem.Header> 
                        </telerik:RadPanelBarItem> 
     
                        <telerik:RadPanelBarItem> 
                            <telerik:RadPanelBarItem.Header> 
                                <StackPanel Orientation="Horizontal" Margin="5"
                                    <Label Width="130" HorizontalContentAlignment="Right" Name="commentLabel" Content="Komentarz" /> 
                                    <TextBox KeyboardNavigation.IsTabStop="False" KeyboardNavigation.TabNavigation="Local" KeyboardNavigation.TabIndex="0" Name="commentTextBox" Width="300" HorizontalAlignment="Left" /> 
                                </StackPanel> 
                            </telerik:RadPanelBarItem.Header> 
                        </telerik:RadPanelBarItem> 
                    </telerik:RadPanelBarItem> 
     
                    <telerik:RadPanelBarItem IsExpanded="True"
                        <telerik:RadPanelBarItem.Header> 
                            <TextBlock Text="Kontakt" Margin="5 4 5 5" FontWeight="Bold" FontSize="14" /> 
                        </telerik:RadPanelBarItem.Header> 
     
                        <telerik:RadPanelBarItem> 
                            <telerik:RadPanelBarItem.Header> 
                                <StackPanel Orientation="Horizontal" Margin="5"
                                    <Label Width="130" HorizontalContentAlignment="Right" Name="phone_1Label" Content="Telefon" /> 
                                    <TextBox KeyboardNavigation.IsTabStop="False" TabIndex="4" Width="170" Name="phone_1TextBox"/> 
                                    <Label Width="130" HorizontalContentAlignment="Right" Name="phone_2Label" Content="Telefon" /> 
                                    <TextBox KeyboardNavigation.IsTabStop="False" TabIndex="5" Width="170" Name="phone_2TextBox"/> 
                                </StackPanel> 
                            </telerik:RadPanelBarItem.Header> 
                        </telerik:RadPanelBarItem> 
     
                        <telerik:RadPanelBarItem> 
                            <telerik:RadPanelBarItem.Header> 
                                <StackPanel Orientation="Horizontal" Margin="5"
                                    <Label Width="130" HorizontalContentAlignment="Right" Name="faxLabel" Content="Fax" /> 
                                    <TextBox KeyboardNavigation.IsTabStop="False" TabIndex="6" Width="170" Name="faxTextBox"/> 
                                </StackPanel> 
                            </telerik:RadPanelBarItem.Header> 
                        </telerik:RadPanelBarItem> 
     
                        <telerik:RadPanelBarItem> 
                            <telerik:RadPanelBarItem.Header> 
                                <StackPanel Orientation="Horizontal" Margin="5"
                                    <Label Width="130" HorizontalContentAlignment="Right" Name="emailLabel" Content="E-mail" /> 
                                    <TextBox KeyboardNavigation.IsTabStop="False" TabIndex="7" Width="170" Name="emailTextBox"/> 
                                    <Label Width="130" HorizontalContentAlignment="Right" Name="emailDomainLabel" Content="Domena e-mail" /> 
                                    <TextBox KeyboardNavigation.IsTabStop="False" TabIndex="8" Width="170" Name="emailDomainTextBox"/> 
                                </StackPanel> 
                            </telerik:RadPanelBarItem.Header> 
                        </telerik:RadPanelBarItem> 
     
                        <telerik:RadPanelBarItem> 
                            <telerik:RadPanelBarItem.Header> 
                                <StackPanel Orientation="Horizontal" Margin="5"
                                    <Label Width="130" HorizontalContentAlignment="Right" Name="wwwLabel" Content="Strona WWW" /> 
                                    <TextBox KeyboardNavigation.IsTabStop="False" TabIndex="9" Width="170" Name="wwwTextBox"/> 
                                </StackPanel> 
                            </telerik:RadPanelBarItem.Header> 
                        </telerik:RadPanelBarItem> 
                    </telerik:RadPanelBarItem> 
     
                    <telerik:RadPanelBarItem IsExpanded="True"
                        <telerik:RadPanelBarItem.Header> 
                            <TextBlock Text="Adres" Margin="5 4 5 5" FontWeight="Bold" FontSize="14" /> 
                        </telerik:RadPanelBarItem.Header> 
     
                        <telerik:RadPanelBarItem> 
                            <telerik:RadPanelBarItem.Header> 
                                <StackPanel Orientation="Horizontal" Margin="5"
                                    <Label Width="130" HorizontalContentAlignment="Right" Name="cityLabel" Content="Miejscowość" /> 
                                    <TextBox KeyboardNavigation.IsTabStop="False" TabIndex="10" Width="170" Name="cityTextBox"/> 
                                    <Label Width="130" HorizontalContentAlignment="Right" Name="zipCodeLabel" Content="Kod pocztowy" /> 
                                    <TextBox KeyboardNavigation.IsTabStop="False" TabIndex="11" Width="170" Name="zipCodeTextBox"/> 
                                </StackPanel> 
                            </telerik:RadPanelBarItem.Header> 
                        </telerik:RadPanelBarItem> 
     
                        <telerik:RadPanelBarItem> 
                            <telerik:RadPanelBarItem.Header> 
                                <StackPanel Orientation="Horizontal" Margin="5"
                                    <Label Width="130" HorizontalContentAlignment="Right" Name="address_1Label" Content="Ulica"/> 
                                    <TextBox KeyboardNavigation.IsTabStop="False" TabIndex="12" Width="170" Name="address_1TextBox" /> 
                                    <Label Width="130" HorizontalContentAlignment="Right" Name="address_2Label" Content="Nr. domu" /> 
                                    <TextBox KeyboardNavigation.IsTabStop="False" TabIndex="13" Width="170" Name="address_2TextBox" /> 
                                    <Label Width="70" HorizontalContentAlignment="Right" Name="address_3Label" Content="Lokal" /> 
                                    <TextBox KeyboardNavigation.IsTabStop="False" TabIndex="14" Width="100" Name="address_3TextBox" /> 
                                </StackPanel> 
                            </telerik:RadPanelBarItem.Header> 
                        </telerik:RadPanelBarItem> 
     
                        <telerik:RadPanelBarItem> 
                            <telerik:RadPanelBarItem.Header> 
                                <StackPanel Orientation="Horizontal" Margin="5"
                                    <Label Width="130" HorizontalContentAlignment="Right" Name="postLabel" Content="Poczta"/> 
                                    <TextBox KeyboardNavigation.IsTabStop="False" TabIndex="15" Width="170" Name="postTextBox" /> 
                                    <Label Width="130" HorizontalContentAlignment="Right" Name="countryLabel" Content="Kraj" /> 
                                    <TextBox KeyboardNavigation.IsTabStop="False" TabIndex="16" Width="170" Name="countryTextBox" /> 
                                </StackPanel> 
                            </telerik:RadPanelBarItem.Header> 
                        </telerik:RadPanelBarItem> 
                    </telerik:RadPanelBarItem> 
     
                </telerik:RadPanelBar> 
            </Grid> 
        </DockPanel> 

  5. Zbigniew Kozłowski
    Zbigniew Kozłowski avatar
    60 posts
    Member since:
    Apr 2010

    Posted 24 Apr 2010 Link to this post

    Ok its working now, ive changed Docpanel into Stackpanel and its ok now :) Thanks for help.

    Regards,
    Zbigniew Kozłowski
  6. Answer
    Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 24 Apr 2010 Link to this post

    Hi Zbigniew Kozłowski,

     I am glad I was able to help.

    Let us know if you need more info.

    All the best,
    Tina Stancheva
    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.
Back to Top
UI for WPF is Visual Studio 2017 Ready