Custom user control looks different when added to window - wpf

I created a custom user control, and it looks like this:
XAML for the control is:
<Grid>
<Label Content="Job #" Height="28" HorizontalAlignment="Left" Margin="6,14,0,0" Name="label1" Style="{StaticResource MyLabel2}" VerticalAlignment="Top" Width="48" HorizontalContentAlignment="Right" />
<Label Content="Customer" Height="28" HorizontalAlignment="Left" Margin="6,41,0,0" Name="label2" Style="{StaticResource MyLabel2}" VerticalAlignment="Top" Width="48" HorizontalContentAlignment="Right" />
<Label Content="Location" Height="28" HorizontalAlignment="Left" Margin="6,68,0,0" Name="label3" Style="{StaticResource MyLabel2}" VerticalAlignment="Top" Width="48" HorizontalContentAlignment="Right" />
<Label Content="Crossing" Height="28" HorizontalAlignment="Left" Margin="6,95,0,0" Name="label4" Style="{StaticResource MyLabel2}" VerticalAlignment="Top" Width="48" HorizontalContentAlignment="Right" />
<Label Content="Engineer" Height="28" HorizontalAlignment="Left" Margin="6,122,0,0" Name="label5" Style="{StaticResource MyLabel2}" VerticalAlignment="Top" Width="48" HorizontalContentAlignment="Right" />
<Label Content="Probe #" Height="28" HorizontalAlignment="Left" Margin="6,149,0,0" Name="label6" Style="{StaticResource MyLabel2}" VerticalAlignment="Top" Width="48" HorizontalContentAlignment="Right" />
<Label Content="Default" Height="28" HorizontalAlignment="Left" Margin="53,14,0,0" Name="lblJob" Style="{StaticResource MyLabel3}" VerticalAlignment="Top" Width="120" />
<Label Content="Default" Height="28" HorizontalAlignment="Left" Margin="53,41,0,0" Name="lblCustomer" Style="{StaticResource MyLabel3}" VerticalAlignment="Top" Width="120" />
<Label Content="Default" Height="28" HorizontalAlignment="Left" Margin="53,68,0,0" Name="lblLocation" Style="{StaticResource MyLabel3}" VerticalAlignment="Top" Width="120" />
<Label Content="Default" Height="28" HorizontalAlignment="Left" Margin="53,95,0,0" Name="lblCrossing" Style="{StaticResource MyLabel3}" VerticalAlignment="Top" Width="120" />
<Label Content="Default" Height="28" HorizontalAlignment="Left" Margin="53,122,0,0" Name="lblEngineer" Style="{StaticResource MyLabel3}" VerticalAlignment="Top" Width="120" />
<Label Content="Default" Height="28" HorizontalAlignment="Left" Margin="53,149,0,0" Name="lblProbe" Style="{StaticResource MyLabel3}" VerticalAlignment="Top" Width="120" />
<Label Content="Away" Height="28" HorizontalAlignment="Left" Margin="204,41,0,0" Name="label14" Style="{StaticResource MyLabel2}" VerticalAlignment="Top" Width="55" />
<Label Content="Elevation" Height="28" HorizontalAlignment="Left" Margin="204,68,0,0" Name="label15" Style="{StaticResource MyLabel2}" VerticalAlignment="Top" Width="55" />
<Label Content="Right" Height="28" HorizontalAlignment="Left" Margin="204,95,0,0" Name="label16" Style="{StaticResource MyLabel2}" VerticalAlignment="Top" Width="55" />
<Label Content="Inclination" Height="28" HorizontalAlignment="Left" Margin="204,122,0,0" Name="label17" Style="{StaticResource MyLabel2}" VerticalAlignment="Top" Width="55" />
<Label Content="Baseline" Height="28" HorizontalAlignment="Left" Margin="204,149,0,0" Name="label18" Style="{StaticResource MyLabel2}" VerticalAlignment="Top" Width="55" />
<Label Content="Default" Height="28" HorizontalAlignment="Left" Margin="258,41,0,0" Name="lblAway" Style="{StaticResource MyLabel3}" VerticalAlignment="Top" Width="120" />
<Label Content="Default" Height="28" HorizontalAlignment="Left" Margin="258,68,0,0" Name="lblElevation" Style="{StaticResource MyLabel3}" VerticalAlignment="Top" Width="120" />
<Label Content="Default" Height="28" HorizontalAlignment="Left" Margin="258,95,0,0" Name="lblRight" Style="{StaticResource MyLabel3}" VerticalAlignment="Top" Width="120" />
<Label Content="Default" Height="28" HorizontalAlignment="Left" Margin="258,122,0,0" Name="lblInclination" Style="{StaticResource MyLabel3}" VerticalAlignment="Top" Width="120" />
<Label Content="Default" Height="28" HorizontalAlignment="Left" Margin="258,149,0,0" Name="lblBaseline" Style="{StaticResource MyLabel3}" VerticalAlignment="Top" Width="120" />
<Label Content="Entry" Height="28" HorizontalAlignment="Left" Margin="338,12,0,0" Name="label13" Style="{StaticResource MyLabel2}" VerticalAlignment="Top" Width="40" />
<Label Content="Default" Height="28" HorizontalAlignment="Left" Margin="377,12,0,0" Name="lblEntry" Style="{StaticResource MyLabel3}" VerticalAlignment="Top" Width="120" />
<Label Content="Exit" Height="28" HorizontalAlignment="Left" Margin="521,12,0,0" Name="label25" Style="{StaticResource MyLabel2}" VerticalAlignment="Top" Width="40" />
<Label Content="Default" Height="28" HorizontalAlignment="Left" Margin="560,12,0,0" Name="lblExit" Style="{StaticResource MyLabel3}" VerticalAlignment="Top" Width="120" />
<Label Content="Units" Height="28" HorizontalAlignment="Left" Margin="706,12,0,0" Name="label27" Style="{StaticResource MyLabel2}" VerticalAlignment="Top" Width="40" />
<Label Content="Default" Height="28" HorizontalAlignment="Left" Margin="745,12,0,0" Name="lblUnits" Style="{StaticResource MyLabel3}" VerticalAlignment="Top" Width="120" />
<DataGrid AutoGenerateColumns="True" Height="275" Margin="12,186,0,0" Name="dataGrid1" VerticalAlignment="Top" HorizontalAlignment="Left" Width="849" />
</Grid>
Yet, when I add it to the window that it's going to be in, it looks like this:
XAML for the Window is:
<Grid>
<SurveyReport:SurveyReport Margin="0,12,0,0" Height="727" VerticalAlignment="Top" HorizontalAlignment="Left" Width="1425" />
</Grid>
Now, when I run the program, it appears the way that it should. But in the designer, it looks all messed up. All my other custom controls look the way that they should. It's just this one that is giving me issues. Is there a reason for this?

Related

Textbox Border Not Showing - WPF

The textbox top and bottom border is not showing.
I have provided the entire XAML code for the main window. I have tried increasing the BorderThickness and also changed the BorderBrush. That did not work.
XAML:
<Window x:Class="WpfApplication6.Window1"
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:local="clr-namespace:WpfApplication6"
mc:Ignorable="d"
Title="Activation Window" Height="300" Width="518.797">
<Grid>
<TextBox x:Name="txtFirstDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="23,171,0,76" BorderThickness="1" BorderBrush="Black" />
<TextBox x:Name="txtSecondDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="81,171,0,76"/>
<TextBox x:Name="txtThirdDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="138,171,0,76"/>
<TextBox x:Name="txtFourthDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="195,171,0,76"/>
<TextBox x:Name="txtFifthDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="252,171,0,76"/>
<Label x:Name="label" Content="Product key:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="23,142,0,0"/>
<TextBox x:Name="txtFirstDigit_Copy" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="274" Margin="23,111,0,136" />
<Label x:Name="label_Copy" Content="Email:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="23,81,0,0"/>
<TextBox x:Name="txtFirstDigit_Copy1" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="130" Margin="23,55,0,192" />
<Label x:Name="label_Copy1" Content="First Name:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="23,25,0,0"/>
<TextBox x:Name="txtFirstDigit_Copy2" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="130" Margin="167,55,0,192" />
<Button x:Name="button" Content="Next" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="142,220,0,0"/>
<Button x:Name="button1" Content="Cancel" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="222,220,0,0" Click="button1_Click"/>
<TextBlock x:Name="textBlock" HorizontalAlignment="Left" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" Margin="350,147,0,0"/>
</Grid>
</Window>
I'd try something like this:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
</Grid.RowDefinitions>
<Label x:Name="label_Copy1" Grid.Row="0" Content="First Name:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="23,0,0,0" />
<StackPanel Orientation="Horizontal" Grid.Row="1">
<TextBox x:Name="txtFirstDigit_Copy1" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="130" Margin="23,0,0,0" />
<TextBox x:Name="txtFirstDigit_Copy2" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="130" Margin="11.5,0,0,0" />
</StackPanel>
<Label x:Name="label_Copy" Grid.Row="2" Content="Email:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="23,0,0,0" />
<TextBox x:Name="txtFirstDigit_Copy" Grid.Row="3" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="270" Margin="23,0,0,0" />
<Label x:Name="label" Grid.Row="4" Content="Product key:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="23,0,0,0" />
<StackPanel Orientation="Horizontal" Grid.Row="5">
<TextBox x:Name="txtFirstDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="23,0,0,0" BorderThickness="1" />
<TextBox x:Name="txtSecondDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="11.5,0,0,0" />
<TextBox x:Name="txtThirdDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="11.5,0,0,0" />
<TextBox x:Name="txtFourthDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="11.5,0,0,0" />
<TextBox x:Name="txtFifthDigit" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Center" Width="45" Margin="11.5,0,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="6">
<Button x:Name="button" Content="Next" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="132,0,0,0" />
<Button x:Name="button1" Content="Cancel" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="11.5,0,0,0" />
</StackPanel>
</Grid>

WPF Labels 2-n in StackPanel not visible

I am going through the tutorial here and for whatever reason, the labels for FirstName, LastName, and City are not visible, neither at design time nor at runtime. I've tried deleting them and re-adding and I get the same result. Can anyone see what is causing them to be hidden?
<Grid Margin="0,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="73*"/>
<RowDefinition Height="247*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="259*"/>
<ColumnDefinition Width="258*"/>
</Grid.ColumnDefinitions>
<Button x:Name="btnSave" Content="Save" Grid.Column="1" HorizontalAlignment="Right" Margin="0,10,10,0" Width="60" Height="22" VerticalAlignment="Top"/>
<Button x:Name="btnRevert" Content="Revert" Grid.Column="1" HorizontalAlignment="Right" Margin="0,10,86,0" Width="60" RenderTransformOrigin="-0.047,0.36" Height="22" VerticalAlignment="Top"/>
<Button x:Name="btnAdd" Content="Add" Grid.Column="1" HorizontalAlignment="Right" Margin="0,10,162,0" VerticalAlignment="Top" Width="60"/>
<Button x:Name="btnDelete" Content="Delete" HorizontalAlignment="Right" Margin="0,10,238,0" VerticalAlignment="Top" Width="60" RenderTransformOrigin="-1.521,0.477" Grid.Column="1"/>
<Button x:Name="btnFirst" Content="|<" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="35"/>
<Button x:Name="btnFirst_Copy" Content="|<" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="35"/>
<Button x:Name="btnPrevious" Content="<" HorizontalAlignment="Left" Margin="54,10,0,0" VerticalAlignment="Top" Width="35"/>
<Button x:Name="btnNext" Content=">" HorizontalAlignment="Left" Margin="94,10,0,0" VerticalAlignment="Top" Width="35"/>
<Button x:Name="btnLast" Content=">|" HorizontalAlignment="Left" Margin="134,10,0,0" VerticalAlignment="Top" Width="35" RenderTransformOrigin="4.102,1.005"/>
<StackPanel HorizontalAlignment="Left" Height="28" Grid.Row="1" VerticalAlignment="Top" Width="304">
<Label x:Name="lblCustomerID" Content="Customer ID" Height="28"/>
<Label x:Name="lblFirstName" Content="First Name" Height="28"/>
<Label x:Name="lblLastName" Content="Last Name" Height="28"/>
<Label x:Name="lblCity1" Content="City" Height="28"/>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Left" Height="251" Grid.Row="1" VerticalAlignment="Top" Width="297">
<TextBox x:Name="txtCustomerID" Height="28" TextWrapping="Wrap" Width="Auto" Text="{Binding Path=CustomerID, Mode=OneWay}"/>
<TextBox x:Name="txtLastName" Height="28" TextWrapping="Wrap" Width="Auto" Text="{Binding Path=LastName}"/>
<TextBox x:Name="txtFirstName" Height="28" TextWrapping="Wrap" Width="Auto" Text="{Binding Path=FirstName}"/>
<TextBox x:Name="txtCity" Height="28" TextWrapping="Wrap" Width="Auto" Text="{Binding Path=City}"/>
</StackPanel>
</Grid>
Remove your StackPanel's Height. Let it fill its height automatically. You set it to 28 which makes the other children get cutted off.
<StackPanel HorizontalAlignment="Left" Grid.Row="1" VerticalAlignment="Top" Width="304">
<Label x:Name="lblCustomerID" Content="Customer ID" Height="28"/>
<Label x:Name="lblFirstName" Content="First Name" Height="28"/>
<Label x:Name="lblLastName" Content="Last Name" Height="28"/>
<Label x:Name="lblCity1" Content="City" Height="28"/>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Left" Grid.Row="1" VerticalAlignment="Top" Width="297">
<TextBox x:Name="txtCustomerID" Height="28" TextWrapping="Wrap" Width="Auto" Text="{Binding Path=CustomerID, Mode=OneWay}"/>
<TextBox x:Name="txtLastName" Height="28" TextWrapping="Wrap" Width="Auto" Text="{Binding Path=LastName}"/>
<TextBox x:Name="txtFirstName" Height="28" TextWrapping="Wrap" Width="Auto" Text="{Binding Path=FirstName}"/>
<TextBox x:Name="txtCity" Height="28" TextWrapping="Wrap" Width="Auto" Text="{Binding Path=City}"/>
</StackPanel>

PivotItem ScrollViewer can't scroll down

PivotItem ScrollViewer can't scroll down
For whatever the reason just won't scroll down when content that is bound inside the pivot item is longer than the height of the page. I tried adding a grid inside the pivotitem with height set to auto, but to no avail.
<controls:PivotItem>
<controls:PivotItem.Header>
<Grid>
<TextBlock Name="TextBlockPropertyDetail" FontSize="31" Text="Property Detail" />
</Grid>
</controls:PivotItem.Header>
<ScrollViewer>
<Grid Height="Auto">
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock1" Text="Property Id" VerticalAlignment="Top" Width="189" Foreground="Black" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,41,0,0" Name="textBlock2" Text="County" VerticalAlignment="Top" Width="189" Foreground="Black" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,77,0,0" Name="textBlock3" Text="Parcel Number" VerticalAlignment="Top" Width="189" Foreground="Black" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,113,0,0" Name="textBlock4" Text="Market Value" VerticalAlignment="Top" Width="189" Foreground="Black" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,149,0,0" Name="textBlock5" Text="Document Image" VerticalAlignment="Top" Width="189" Foreground="Black" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,185,0,0" Name="textBlock6" Text="Value Range" VerticalAlignment="Top" Width="189" Foreground="Black" />
<TextBlock Height="30" Margin="12,221,279,0" Name="textBlock7" Text="Insured" VerticalAlignment="Top" Foreground="Black" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,257,0,0" Name="textBlock8" Text="Case Number" VerticalAlignment="Top" Width="189" Foreground="Black" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,293,0,0" Name="textBlock9" Text="Recording Date" VerticalAlignment="Top" Width="189" Foreground="Black" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,329,0,0" Name="textBlock10" Text="Recording Book" VerticalAlignment="Top" Width="189" Foreground="Black" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,365,0,0" Name="textBlock11" Text="Recording Page" VerticalAlignment="Top" Width="189" Foreground="Black" />
<TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,5,0,0" Name="tbkPropertyId" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,41,0,0" Name="tbkCounty" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,77,0,0" Name="tbkParcelNo" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,113,0,0" Name="tbkMarketValue" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,149,0,0" Name="tbkDocumentImage" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,185,0,0" Name="tbkValueRange" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,221,0,0" Name="tbkInsured" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,257,0,0" Name="tbkCaseNo" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,293,0,0" Name="tbkRecordingDate" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,329,0,0" Name="tbkRecordingBook" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,365,0,0" Name="tbkRecordingPage" Text="Loading..." VerticalAlignment="Top" Width="189" />
</Grid>
</ScrollViewer>
</controls:PivotItem>
Thanks for any advice.
Use the Stackpanel in the grid Element and try this.
<controls:Pivot Title="MY APPLICATION">
<!--Pivot item one-->
<controls:PivotItem Header="first" Height="580" >
<!--Double line list with text wrapping-->
<ScrollViewer>
<Grid>
<StackPanel>
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock1" Text="Property Id" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock2" Text="County" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock3" Text="Parcel Number" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock4" Text="Market Value" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock5" Text="Document Image" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock6" Text="Value Range" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" Margin="12,5,279,0" Name="textBlock7" Text="Insured" VerticalAlignment="Top" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock8" Text="Case Number" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock9" Text="Recording Date" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock10" Text="Recording Book" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock11" Text="Recording Page" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-385,0,0" Name="tbkPropertyId" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-350,0,0" Name="tbkCounty" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-315,0,0" Name="tbkParcelNo" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-275,0,0" Name="tbkMarketValue" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-240,0,0" Name="tbkDocumentImage" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-205,0,0" Name="tbkValueRange" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-170,0,0" Name="tbkInsured" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-135,0,0" Name="tbkCaseNo" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-100,0,0" Name="tbkRecordingDate" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-65,0,0" Name="tbkRecordingBook" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-30,0,0" Name="tbkRecordingPage" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlsock1" Text="Property Id" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textsBlock2" Text="County" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBslock3" Text="Parcel Number" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textsBlock4" Text="Market Value" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textsBlock5" Text="Document Image" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textsBlock6" Text="Value Range" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlocsk7" Text="Insured" VerticalAlignment="Top" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBslock8" Text="Case Number" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBslock9" Text="Recording Date" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlsock10" Text="Recording Book" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBsock11" Text="Recording Page" VerticalAlignment="Top" Width="189" Foreground="White" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-380,0,0" Name="tbkPropsertyId" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-345,0,0" Name="tbkCosunty" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-310,0,0" Name="tbkPasrcelNo" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-275,0,0" Name="tbkMsarketValue" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-240,0,0" Name="tbkDsocumentImage" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-205,0,0" Name="s" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-170,0,0" Name="tsbkInsured" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-135,0,0" Name="tbskCaseNo" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-100,0,0" Name="tbskRecordingDate" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-70,0,0" Name="tbksRecordingBook" Text="Loading..." VerticalAlignment="Top" Width="189" />
<TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-35,0,0" Name="tbkRsecordingPage" Text="Loading..." VerticalAlignment="Top" Width="189" />
</StackPanel>
</Grid>
</ScrollViewer>
</controls:PivotItem>
</controls:Pivot>
And I hope you will get the Solution.

Use styles define in application resources

I'm having problem using any styles that are defined in my Application resources in another classes. These are the contents of my App.xaml class. When I try to apply the TextBox class I get error: cannot find named resource "validationTextboxStyle"
<Application x:Class="ClientApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
StartupUri="LoginWindow.xaml">
<Application.Resources>
<Style x:Key="validationTextboxStyle" TargetType="TextBox">
<Setter Property="Validation.ErrorTemplate">
<Setter.Value>
<ControlTemplate>
<DockPanel LastChildFill="True">
<TextBlock DockPanel.Dock="Right"
Foreground="Orange"
FontSize="12pt">
!!!!
</TextBlock>
<Border BorderBrush="Green" BorderThickness="1">
<AdornedElementPlaceholder />
</Border>
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Application.Resources>
<Application.MainWindow>
<NavigationWindow Source="Main.xaml"></NavigationWindow>
</Application.MainWindow>
I try to use the style in another window.
<Window x:Class="ClientApp.NewItem"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:validation="clr-namespace:ClientApp.ValidationRules"
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
Height="520" Width="400"
WindowStartupLocation="CenterOwner">
<Window.CommandBindings>
<CommandBinding Command="ApplicationCommands.Save"
CanExecute="SaveCanExecute"
Executed="SaveExecuted" />
</Window.CommandBindings>
<Window.Resources>
</Window.Resources>
<TabControl Height="Auto" Name="tabControl1" Width="Auto">
<TabItem Header="General" Name="tabItem1">
<extToolkit:BusyIndicator x:Name="busyIndicator" Visibility="Visible">
<Grid Name="contentGrid">
<extToolkit:ChildWindow Name="generateWindowChild" IsModal="True" Height="222" Width="300" WindowStartupLocation="Center" Grid.Column="0" Grid.ColumnSpan="6" Grid.Row="0" Grid.RowSpan="10">
<Grid>
<TextBox Height="23" HorizontalAlignment="Left" Margin="12,14,0,0" Name="txt_password" VerticalAlignment="Top" Width="242" />
<CheckBox Content="Numbers" IsChecked="True" Height="16" HorizontalAlignment="Left" Margin="16,79,0,0" Name="chk_numbers" VerticalAlignment="Top" />
<Button Content="Generate" Height="23" HorizontalAlignment="Left" Margin="58,152,0,0" Name="btn_generatePass" VerticalAlignment="Top" Width="75" Click="btn_generatePass_Click" />
<CheckBox Content="Upper case letters" IsChecked="True" Height="16" HorizontalAlignment="Left" Margin="16,123,0,0" Name="chk_special" VerticalAlignment="Top" />
<CheckBox Content="Special characters" IsChecked="True" Height="16" HorizontalAlignment="Left" Margin="16,101,0,0" Name="chk_upper" VerticalAlignment="Top" />
<Button Content="Insert" Height="23" HorizontalAlignment="Left" Margin="145,152,0,0" Name="btn_InsertPass" VerticalAlignment="Top" Width="75" Click="btn_InsertPass_Click" />
<extToolkit:IntegerUpDown DefaultValue="8" Value="8" Height="25" Width="35" Visibility="Visible" Margin="88,46,145,115" Name="minUpDown" PreviewKeyDown="minUpDown_PreviewKeyDown" ValueChanged="minUpDown_ValueChanged" />
<extToolkit:IntegerUpDown DefaultValue="8" Value="8" Height="25" Width="35" Margin="0,46,24,115" Name="maxUpDown" PreviewKeyDown="maxUpDown_PreviewKeyDown" ValueChanged="maxUpDown_ValueChanged" HorizontalAlignment="Right" />
<Label Content="Min length:" Height="28" HorizontalAlignment="Left" Margin="16,45,0,0" Name="minLengthLabel" VerticalAlignment="Top" />
<Label Content="Max length:" Height="28" HorizontalAlignment="Right" Margin="0,45,69,0" Name="maxLengthLabel" VerticalAlignment="Top" />
</Grid>
</extToolkit:ChildWindow>
<TextBox HorizontalAlignment="Left" Style="{StaticResource validationTextboxStyle}" VerticalAlignment="Top" Width="120" Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2" LostFocus="TextBox_LostFocus">
<TextBox.Text>
<Binding Path="GroupName" UpdateSourceTrigger="LostFocus" Mode="TwoWay">
<Binding.ValidationRules><validation:ItemGroupNameValidationRule /></Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
<TextBox HorizontalAlignment="Left" Style="{StaticResource validationTextboxStyle}" VerticalAlignment="Top" Width="120" Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="2" >
<TextBox.Text>
<Binding Path="Title" UpdateSourceTrigger="LostFocus" Mode="TwoWay">
<Binding.ValidationRules><validation:ItemTitleValidationRule /></Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
<TextBox HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="2">
<TextBox.Text>
<Binding Path="username" UpdateSourceTrigger="LostFocus" Mode="TwoWay">
<Binding.ValidationRules><validation:ItemUsernameValidationRule /></Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
<PasswordBox HorizontalAlignment="Left" Name="txt_itemPassword" VerticalAlignment="Top" Width="120" Grid.Row="5" Grid.Column="2" Grid.ColumnSpan="2" LostFocus="txt_itemPassword_LostFocus" />
<PasswordBox HorizontalAlignment="Left" Name="txt_ConfirmPassword" VerticalAlignment="Top" Width="120" Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="2" LostKeyboardFocus="txt_ConfirmPassword_LostKeyboardFocus" />
<Button Content="Generate" HorizontalAlignment="Left" Name="btn_generateNewPass" VerticalAlignment="Top" Width="36" Click="btn_generateNewPass_Click" Grid.Row="6" Grid.Column="4" Grid.ColumnSpan="2"/>
<TextBox HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" Grid.Row="7" Grid.Column="2" Grid.ColumnSpan="2" >
<TextBox.Text>
<Binding Path="Url" UpdateSourceTrigger="LostFocus" Mode="TwoWay">
<Binding.ValidationRules><validation:ItemUrlValidationRule /></Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
<TextBox Height="80" Width="200" Background="White" VerticalAlignment="Top" HorizontalAlignment="Left" Grid.Row="8" Grid.Column="2" Grid.ColumnSpan="6">
<TextBox.Text>
<Binding Path="Note" UpdateSourceTrigger="LostFocus" Mode="TwoWay">
<Binding.ValidationRules><validation:ItemNoteValidationRule /></Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
<ListBox Height="80" HorizontalAlignment="Left" BorderBrush="LightGray" Name="listBox_Roles" VerticalAlignment="Top" Width="200" Grid.Row="9" Grid.Column="2" Grid.ColumnSpan="4">
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsChecked}" Content="{Binding Title}" Checked="checkBoxChanged" Unchecked="checkBoxChanged"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Label Content="Group" HorizontalAlignment="Left" Name="label9" VerticalAlignment="Top" Grid.Row="2" Grid.Column="1" />
<Label Content="Title" HorizontalAlignment="Left" Name="label1" VerticalAlignment="Top" Grid.Row="3" Grid.Column="1"/>
<Label Content="Username" HorizontalAlignment="Left" Name="label2" VerticalAlignment="Top" Grid.Row="4" Grid.Column="1"/>
<Label Content="Password" HorizontalAlignment="Left" Name="label3" VerticalAlignment="Top" Grid.Row="5" Grid.Column="1"/>
<Label Content="Confirm Password" HorizontalAlignment="Left" Name="label7" VerticalAlignment="Top" Grid.Row="6" Grid.Column="1"/>
<Label Content="Url" HorizontalAlignment="Left" Name="label5" VerticalAlignment="Top" Grid.Row="7" Grid.Column="1"/>
<Label Content="Note" HorizontalAlignment="Left" Name="label4" VerticalAlignment="Top" Grid.Row="8" Grid.Column="1"/>
<Label Content="Roles" HorizontalAlignment="Left" Name="label8" VerticalAlignment="Top" Grid.Row="9" Grid.Column="1"/>
<Button Content="Create" Command="ApplicationCommands.Save" IsDefault="True" HorizontalAlignment="Left" Name="btn_CreateItem" VerticalAlignment="Top" Width="75" Grid.Row="11" Grid.Column="2"/>
<Button Content="Cancel" HorizontalAlignment="Right" IsCancel="True" Name="btn_CancelCreateItem" VerticalAlignment="Top" Width="75" Click="btn_CancelCreateItem_Click" Grid.Row="11" Grid.Column="3" Grid.ColumnSpan="2"/>
</Grid>
</extToolkit:BusyIndicator>
</TabItem>
<TabItem Header="Expiration" Name="tabItem2">
<GroupBox Header="Expiration Rule" Height="229" Name="groupBox1" Width="469" VerticalAlignment="top" HorizontalAlignment="Left">
<Grid Height="210">
<Grid.RowDefinitions>
<RowDefinition Height="66*" />
<RowDefinition Height="144*" />
</Grid.RowDefinitions>
<RadioButton GroupName="passwordExpiration" Content="Never" IsChecked="True" Height="16" HorizontalAlignment="Left" Margin="38,22,0,0" Name="radioExpiresNever" VerticalAlignment="Top" />
<RadioButton GroupName="passwordExpiration" Content="In" Height="16" Name="radioExpiresInDays" Margin="36,65,-36,129" Grid.RowSpan="2" />
<extToolkit:IntegerUpDown Name="expiresInDaysUpDown" Margin="152,61,232,127" Height="22" Grid.RowSpan="2"></extToolkit:IntegerUpDown>
<Label Name="daysRecurring" Content="Days" Margin="231,58,0,117" HorizontalAlignment="Left" Width="38" Grid.RowSpan="2"></Label>
<RadioButton GroupName="passwordExpiration" Content="On" Height="16" HorizontalAlignment="Left" Margin="38,38,0,0" Name="radioExpiresDate" VerticalAlignment="Top" Grid.Row="1" />
<extToolkit:DateTimePicker Name="expirationDate" Width="203" Height="21" Margin="152,40,102,83" Grid.Row="1"></extToolkit:DateTimePicker>
</Grid>
</GroupBox>
</TabItem>
</TabControl>

Overlapping Grids inside a Tab

I have two grids inside a TabItem and in the code-behind I want to be able to add controls to both grids and have all the controls visible at run-time. Currently at run-time the controls added to "Grid3" are not visible while he controls added to "Grid4" are visible.
The overlapping grids have the same rows but a different set of columns.
I'm trying to do this with two grids so that I can vary the number of controls I can add per row in the code-behind by adding the controls to one of the two grids.
Here's the XML:
<Grid Name="TabControlGrid" Margin="20,171,0,70">
<TabControl >
<TabItem Header="Tab1" >
<Grid Name="InnerTabControlGrid">
<!--Start Grid3-->
<Grid Name="Grid3" Background="#FFE3EFFF" Height="188">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="98*" />
<ColumnDefinition Width="296*" />
<ColumnDefinition Width="88*" />
<ColumnDefinition Width="327*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="10*" />
<RowDefinition Height="26*" />
<RowDefinition Height="26*" />
<RowDefinition Height="26*" />
<RowDefinition Height="26*" />
<RowDefinition Height="26*" />
<RowDefinition Height="26*" />
<RowDefinition Height="30*" />
</Grid.RowDefinitions>
<Grid Name="InnerGrid3" Grid.ColumnSpan="4" Grid.RowSpan="8" VerticalAlignment="Top" HorizontalAlignment="Left" Width="807">
<TextBlock Height="23" HorizontalAlignment="Left" Margin="10,10,0,0" Name="TextBlock1" Text="Row 1, Col 1" VerticalAlignment="Top" Width="71" Visibility="Collapsed"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="10,35,0,0" Name="TextBlock2" Text="Row 2, Col 1" VerticalAlignment="Top" Width="71" Visibility="Collapsed"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="10,60,0,0" Name="TextBlock3" Text="Row 3, Col 1" VerticalAlignment="Top" Width="71" Visibility="Collapsed"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="10,85,0,0" Name="TextBlock4" Text="Row 4, Col 1" VerticalAlignment="Top" Width="71" Visibility="Collapsed"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="10,110,0,0" Name="TextBlock5" Text="Row 5, Col 1" VerticalAlignment="Top" Width="71" Visibility="Collapsed"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="10,135,0,0" Name="TextBlock6" Text="Row 6, Col 1" VerticalAlignment="Top" Width="71" Visibility="Collapsed"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="10,160,0,0" Name="TextBlock7" Text="Row 7, Col 1" VerticalAlignment="Top" Width="71" Visibility="Collapsed"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="405,10,0,0" Name="TextBlock8" Text="Row 1, Col 2" VerticalAlignment="Top" Width="71" Visibility="Collapsed"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="405,35,0,0" Name="TextBlock9" Text="Row 2, Col 2" VerticalAlignment="Top" Width="71" Visibility="Collapsed"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="405,60,0,0" Name="TextBlock10" Text="Row 3, Col 2" VerticalAlignment="Top" Width="71" Visibility="Collapsed"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="405,85,0,0" Name="TextBlock11" Text="Row 4, Col 2" VerticalAlignment="Top" Width="71" Visibility="Collapsed"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="405,110,0,0" Name="TextBlock12" Text="Row 5, Col 2" VerticalAlignment="Top" Width="71" Visibility="Collapsed"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="403,135,0,0" Name="TextBlock13" Text="Row 6, Col 2:" VerticalAlignment="Top" Width="71" Visibility="Collapsed"/>
<TextBlock Height="23" HorizontalAlignment="Left" Margin="403,160,0,0" Name="TextBlock14" Text="Row 7, Col 2" VerticalAlignment="Top" Width="71" Visibility="Collapsed"/>
<ComboBox Height="23" HorizontalAlignment="Left" Margin="98,11,0,0" Name="ComboBox9" VerticalAlignment="Top" Width="291" Visibility="Collapsed"/>
<ComboBox Height="23" HorizontalAlignment="Left" Margin="479,10,0,0" Name="ComboBox10" VerticalAlignment="Top" Width="291" Visibility="Collapsed"/>
<ComboBox Height="23" HorizontalAlignment="Left" Margin="98,35,0,0" Name="ComboBox11" VerticalAlignment="Top" Width="291" Visibility="Collapsed"/>
<ComboBox Height="23" HorizontalAlignment="Left" Margin="479,35,0,0" Name="ComboBox12" VerticalAlignment="Top" Width="291" Visibility="Collapsed"/>
<ComboBox Height="23" HorizontalAlignment="Left" Margin="98,60,0,0" Name="ComboBox13" VerticalAlignment="Top" Width="291" Visibility="Collapsed"/>
<ComboBox Height="23" HorizontalAlignment="Left" Margin="479,60,0,0" Name="ComboBox14" VerticalAlignment="Top" Width="291" Visibility="Collapsed"/>
<ComboBox Height="23" HorizontalAlignment="Left" Margin="98,85,0,0" Name="ComboBox15" VerticalAlignment="Top" Width="291" Visibility="Collapsed"/>
<ComboBox Height="23" HorizontalAlignment="Left" Margin="479,85,0,0" Name="ComboBox16" VerticalAlignment="Top" Width="291" Visibility="Collapsed"/>
<ComboBox Height="23" HorizontalAlignment="Left" Margin="98,110,0,0" Name="ComboBox17" VerticalAlignment="Top" Width="291" Visibility="Collapsed"/>
<ComboBox Height="23" HorizontalAlignment="Left" Margin="479,111,0,0" Name="ComboBox18" VerticalAlignment="Top" Width="291" Visibility="Collapsed"/>
<ComboBox Height="23" HorizontalAlignment="Left" Margin="98,135,0,0" Name="ComboBox19" VerticalAlignment="Top" Width="291" Visibility="Collapsed"/>
<ComboBox Height="23" HorizontalAlignment="Left" Margin="479,136,0,0" Name="ComboBox20" VerticalAlignment="Top" Width="291" Visibility="Collapsed"/>
<ComboBox Height="23" HorizontalAlignment="Left" Margin="98,160,0,0" Name="ComboBox21" VerticalAlignment="Top" Width="291" Visibility="Collapsed"/>
<ComboBox Height="23" HorizontalAlignment="Left" Margin="479,160,0,0" Name="ComboBox22" VerticalAlignment="Top" Width="291" Visibility="Collapsed"/>
</Grid>
</Grid>
<!--End Grid3-->
<Grid Name="Grid4" Background="#FFE3EFFF">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="97*" />
<ColumnDefinition Width="102*" />
<ColumnDefinition Width="91*" />
<ColumnDefinition Width="102*" />
<ColumnDefinition Width="87*" />
<ColumnDefinition Width="102*" />
<ColumnDefinition Width="99*" />
<ColumnDefinition Width="125*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="10*" />
<RowDefinition Height="26*" />
<RowDefinition Height="26*" />
<RowDefinition Height="26*" />
<RowDefinition Height="26*" />
<RowDefinition Height="26*" />
<RowDefinition Height="26*" />
<RowDefinition Height="30*" />
</Grid.RowDefinitions>
<Grid Name="InnerGrid4" Grid.ColumnSpan="8" Grid.RowSpan="8" VerticalAlignment="Top" HorizontalAlignment="Left" Width="803" Height="193">
<TextBlock Height="23" HorizontalAlignment="Left" Margin="10,10,0,0" Name="TextBlock15" Text="Row 1, Col 1" VerticalAlignment="Top" Width="73" Visibility="Collapsed" />
<TextBox BorderBrush="#FF898C95" Height="23" HorizontalAlignment="Left" Margin="98,11,0,0" Name="TextBox13a" VerticalAlignment="Top" Width="100" Visibility="Collapsed" />
<TextBlock Height="23" HorizontalAlignment="Left" Margin="210,10,0,0" Name="TextBlock16" Text="Row 1, Col 2" VerticalAlignment="Top" Width="73" Visibility="Collapsed" />
<TextBox BorderBrush="#FF898C95" Height="23" HorizontalAlignment="Left" Margin="289,11,0,0" Name="TextBox14a" VerticalAlignment="Top" Width="100" Visibility="Collapsed" />
<TextBlock Height="23" HorizontalAlignment="Left" Margin="410,12,0,0" Name="TextBlock17" Text="Row 1, Col 3" VerticalAlignment="Top" Width="67" Visibility="Collapsed" />
<ComboBox Height="23" HorizontalAlignment="Left" Margin="479,10,0,0" Name="ComboBox23" VerticalAlignment="Top" Width="100" Visibility="Collapsed" />
<TextBlock Height="23" HorizontalAlignment="Left" Margin="600,14,0,0" Name="TextBlock18" Text="Row 1, Col 4" VerticalAlignment="Top" Width="71" Visibility="Collapsed" />
<TextBox BorderBrush="#FF898C95" Height="23" HorizontalAlignment="Left" Margin="680,11,0,0" Name="TextBox18a" VerticalAlignment="Top" Width="100" Visibility="Collapsed" />
<TextBlock Height="23" HorizontalAlignment="Left" Margin="10,35,0,0" Name="TextBlock19" Text="Row 2, Col 1" VerticalAlignment="Top" Visibility="Collapsed" Width="73" />
<TextBox BorderBrush="#FF898C95" Height="23" HorizontalAlignment="Left" Margin="98,36,0,0" Name="TextBox1" VerticalAlignment="Top" Visibility="Collapsed" Width="100" />
<TextBlock Height="23" HorizontalAlignment="Left" Margin="210,35,0,0" Name="TextBlock20" Text="Row 2, Col 2" VerticalAlignment="Top" Visibility="Collapsed" Width="73" />
<TextBox BorderBrush="#FF898C95" Height="23" HorizontalAlignment="Left" Margin="289,36,0,0" Name="TextBox2" VerticalAlignment="Top" Visibility="Collapsed" Width="100" />
<TextBlock Height="23" HorizontalAlignment="Left" Margin="410,37,0,0" Name="TextBlock21" Text="Row 2, Col 3" VerticalAlignment="Top" Visibility="Collapsed" Width="67" />
<ComboBox Height="23" HorizontalAlignment="Left" Margin="479,35,0,0" Name="ComboBox24" VerticalAlignment="Top" Visibility="Collapsed" Width="100" />
<TextBlock Height="23" HorizontalAlignment="Left" Margin="600,39,0,0" Name="TextBlock22" Text="Row 2, Col 4" VerticalAlignment="Top" Visibility="Collapsed" Width="71" />
<TextBox BorderBrush="#FF898C95" Height="23" HorizontalAlignment="Left" Margin="680,36,0,0" Name="TextBox3" VerticalAlignment="Top" Visibility="Collapsed" Width="100" />
</Grid>
</Grid>
</Grid>
</TabItem>
<TabItem Header="Tab2" >
</TabItem>
</TabControl>
</Grid>
The controls in the XML are just place holders for the controls I am adding to the grids in the code-behind.
If anyone can suggest a solution I'd appreciate it.
Thanks!
-mg
Remove the background from the grid. You can not see through a solid color.
Your InnerTabControlGrid does not define any Row or Column Definitions, so both child grids are placed on top of each other in a single grid cell.
Change InnerTabControlGrid to a DockPanel or a UniformGrid, or give it some Grid.ColumnDefinitions or Grid.RowDefinitions and assign your child grid's Grid.Column or Grid.Row

Resources