RadExpander and RadScheduler side by side

3 posts, 1 answers
  1. Rappen
    Rappen avatar
    11 posts
    Member since:
    Feb 2010

    Posted 16 Mar 2010 Link to this post

    Hi

    I am having serious problems performing something that seems quite simple.
    I want a RadScheduler filling the form, and a RadExpander to the right of it. When I expand the Expander, the Scheduler should decrease its size accordingly.
    When I try this with the Expander on top, it works as intended, but when I put the expander to the right, the scheduler just will not stretch over the form. It stretches well vertically, but not horizontally.
    I believe I have altered the directions etc on the components as I should, but without any luck.

    This is my very small form:
    <Page x:Class="RadControlsWpfBrowserApp2.Page1" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        Title="Page1" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">  
        <Grid> 
            <StackPanel Orientation="Horizontal">  
                <telerik:RadScheduler Name="radScheduler1" HorizontalAlignment="Stretch" /> 
                <telerik:RadExpander ExpandDirection="Left" HorizontalAlignment="Right">  
                    <telerik:RadExpander.Header> 
                        <Grid HorizontalAlignment="Stretch">  
                            <Grid.ColumnDefinitions> 
                                <ColumnDefinition Width="Auto" /> 
                                <ColumnDefinition Width="*" /> 
                            </Grid.ColumnDefinitions> 
                            <TextBlock Text="Header" /> 
                            <Rectangle Grid.Column="1" Margin="5,0,0,0" VerticalAlignment="Center" Height="2" Fill="Gray" /> 
                        </Grid> 
                    </telerik:RadExpander.Header> 
                    <StackPanel Orientation="Vertical" > 
                        <Ellipse Width="33" Height="33" Margin="5" Fill="Yellow" /> 
                        <Ellipse Width="33" Height="33" Margin="5" Fill="Blue" /> 
                        <Ellipse Width="33" Height="33" Margin="5" Fill="Red" /> 
                    </StackPanel> 
                </telerik:RadExpander> 
            </StackPanel> 
        </Grid> 
    </Page> 

    See attached screen shot.
  2. Answer
    Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 19 Mar 2010 Link to this post

    Hi Rappen,

    The reason that RadScheduler is not shredding is that you have used StackPanel. Try to use Grid and it will behave like expected. Try this code:

    <Grid>
           <Grid.ColumnDefinitions>
               <ColumnDefinition Width="*"/>
               <ColumnDefinition Width="Auto"/>
           </Grid.ColumnDefinitions>
           <telerik:RadScheduler Name="radScheduler1" Grid.Column="0" />
           <telerik:RadExpander ExpandDirection="Left" Grid.Column="1">
               <telerik:RadExpander.Header>
                   <Grid HorizontalAlignment="Stretch">
                       <Grid.ColumnDefinitions>
                           <ColumnDefinition Width="Auto" />
                           <ColumnDefinition Width="*" />
                       </Grid.ColumnDefinitions>
                       <TextBlock Text="Header" />
                       <Rectangle Grid.Column="1" Margin="5,0,0,0" VerticalAlignment="Center" Height="2" Fill="Gray" />
                   </Grid>
               </telerik:RadExpander.Header>
               <StackPanel Orientation="Vertical" >
                   <Ellipse Width="33" Height="33" Margin="5" Fill="Yellow" />
                   <Ellipse Width="33" Height="33" Margin="5" Fill="Blue" />
                   <Ellipse Width="33" Height="33" Margin="5" Fill="Red" />
               </StackPanel>
           </telerik:RadExpander>
       </Grid>

    Hope this helps. Let me know if you have more questions.
     

    Regards,
    Boyan
    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. Rappen
    Rappen avatar
    11 posts
    Member since:
    Feb 2010

    Posted 22 Mar 2010 Link to this post

    Great - thank you for helping me out with the grid :)

    /Jonas
Back to Top