Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Silverlight Expander Adjust Grid

Posted on 2011-03-21
3
Medium Priority
?
1,138 Views
Last Modified: 2013-11-12
I am trying to have a tab control that fills the entire width of the browser and an expander on teh right hand side. When expanded it would push the tab control over so it does not just go on top of the tab control.  I have reviewed many samples but cant see what I am missing.
<navigation:Page x:Class="Dashboard.Page1" 
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                 xmlns:ig="http://schemas.infragistics.com/xaml"
                 xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                   xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
                     xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" 
                     xmlns:igGrid="http://schemas.infragistics.com/xaml" 
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="MO Page">

    <Grid x:Name="LayoutRoot">
        <controlsToolkit:BusyIndicator x:Name="cmd_isbusy" Content="" Margin="0,36,0,-3" />
        <Button x:Name="cmd_parameters" HorizontalAlignment="Left" Margin="8,8,0,0" VerticalAlignment="Top" Width="130" Content="Change Parameters" Click="cmd_parameters_Click"/>
        <Button x:Name="cmd_dashboard" Margin="0,8,8,0" VerticalAlignment="Top" Content="Back To Dashboard Selection" HorizontalAlignment="Right" Width="180" Click="cmd_dashboard_Click"/>
        <Grid ShowGridLines="True" x:Name="TemplateArea_" Background="Transparent">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid Grid.Row="0">
                <Grid x:Name="ContentArea_" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid x:Name="DataGridArea_" Margin="0" Background="Transparent" Grid.Column="0" >
                        <controls:TabControl Name="MOTabControl" Margin="0,37,0,0">
                            <controls:TabItem Header="MO HDR" Name="MoHdrTab">
                                <Grid>
                                    
                                </Grid>
                            </controls:TabItem>
                            <controls:TabItem Header="MO Planning Data" Name="MoHdrPlanning">
                            </controls:TabItem>
                            <controls:TabItem Header="MO Allocations" Name="MoHdrAllocations">
                                                      </controls:TabItem>
                            <controls:TabItem Header="MO Serial / Lot" Name="MoHdrSerialLot">
                            </controls:TabItem>
                        </controls:TabControl>
                    </Grid>
                    <controlsToolkit:Expander HorizontalContentAlignment="Left" ExpandDirection="Left" IsExpanded="True" Margin="452,36,0,0" Width="185" HorizontalAlignment="Right" Name="moexpander" Grid.Column="1">
                        <controlsToolkit:Expander.Header>
                            <TextBlock Margin="-158,0,-153,0" VerticalAlignment="Top" Text="Available MO's" TextWrapping="Wrap" Foreground="#FFE1B3B3" RenderTransformOrigin="0.5,0.5"
Grid.ColumnSpan="1" HorizontalAlignment="Center" Width="189" Height="20" d:LayoutOverrides="Height" Grid.Column="0">
<TextBlock.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="-90"/>
<TranslateTransform/>
</TransformGroup>
</TextBlock.RenderTransform>
                            </TextBlock>

                        </controlsToolkit:Expander.Header>
                        <controlsToolkit:Expander.Content>
                            <ListBox x:Name="lstmonumbers" ItemsSource="{Binding molookup}"  HorizontalContentAlignment="Left" Width="159" HorizontalAlignment="Right">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <sdk:Label Content="{Binding MO_ID}" />
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                        </controlsToolkit:Expander.Content>
                    </controlsToolkit:Expander>
                </Grid>
            </Grid>
        </Grid>
    </Grid>
</navigation:Page>

Open in new window

0
Comment
Question by:jimseiwert
3 Comments
 
LVL 3

Accepted Solution

by:
politex earned 1000 total points
ID: 35240419
Hi,  you just need to set for DataGridArea_   HorizontalAlignment="Stretch", working sample:
<UserControl xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  x:Class="SilverlightApplication1.MainPage"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" 
    >
    <Grid >
        <Grid.ColumnDefinitions >
            <ColumnDefinition Width="*"></ColumnDefinition>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
        </Grid.ColumnDefinitions>
    
        <Grid toolkit:DockPanel.Dock="Left"  HorizontalAlignment="Stretch" Grid.Column="0"  Background="Green">
            <sdk:TabControl >
                <sdk:TabItem Header="111"></sdk:TabItem>
                <sdk:TabItem Header="222"></sdk:TabItem>
                <sdk:TabItem Header="333"></sdk:TabItem>
                <sdk:TabItem Header="444"></sdk:TabItem>
                <sdk:TabItem Header="555"></sdk:TabItem>
            </sdk:TabControl>
        </Grid>


        <toolkit:Expander toolkit:DockPanel.Dock="Right" Grid.Column="1"  ExpandDirection="Left" >
            <toolkit:Expander.Header>
                <TextBlock>Header</TextBlock>
            </toolkit:Expander.Header>
            <toolkit:Expander.Content>
                <data:DataGrid Width="250" Background="Red"></data:DataGrid>
            </toolkit:Expander.Content>
        </toolkit:Expander>
</Grid>
</UserControl>

Open in new window

0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question