Solved

Silverlight Expander Adjust Grid

Posted on 2011-03-21
3
1,108 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 250 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now