johardas

johardas

  • NA
  • 18
  • 7.5k

How can i print gird (Like a form) in silverlight 5?

May 6 2013 4:45 AM
Hi,

   How can i print a gird (like a form) its contain text box, combo box... Below i am enclosed my xaml page code. I just want print this design.This sample i have Height="1450" Width="1362" gird also. Pls help me.



<UserControl x:Class="AlphaMCS.UI.Components.DefinitionCreate"
    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"
    mc:Ignorable="d"
             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="#302f2f">
        <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>
                <RowDefinition Height="30"></RowDefinition>
                <RowDefinition Height="30"></RowDefinition>
                <RowDefinition Height="30*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200"></ColumnDefinition>
                <ColumnDefinition Width="200"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <TextBlock Text="Create Definition" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontSize="14" Margin="132,4,107,4" Grid.ColumnSpan="2" Width="161"></TextBlock>
            <TextBox x:Name="txtdefNo" IsHitTestVisible="False" Width="170" Height="24" Grid.Column="1" Grid.Row="1" TabIndex="1"></TextBox>
            <TextBox x:Name="txtDesc" Width="170" Height="24" Grid.Column="1" Grid.Row="2" TabIndex="2"></TextBox>
            <TextBlock Text="*" FontSize="15" Foreground="Red" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="1" Grid.Row="2"  Margin="187,7,0,1"></TextBlock>
            <TextBlock Text="*" FontSize="15" Foreground="Red" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="1" Grid.Row="3"  Margin="187,7,0,1"></TextBlock>
            <!--<TextBlock Text="*" FontSize="15" Foreground="Red" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="1" Grid.Row="4"  Margin="187,7,0,1"></TextBlock>-->
            
            <CheckBox x:Name="chkIsBasic" Grid.Column="1" Grid.Row="5" VerticalAlignment="Center" Margin="15,8,161,6" TabIndex="5" ></CheckBox>
            <CheckBox x:Name="chkActive" Grid.Column="1" IsChecked="True" Grid.Row="6" VerticalAlignment="Center" Margin="15,8,161,6" TabIndex="6"></CheckBox>
            <sdk:DatePicker x:Name="dtpeff" Width="170" Height="24" Grid.Column="1" Grid.Row="3" TabIndex="3"></sdk:DatePicker>
            <sdk:DatePicker x:Name="dtpend" Width="170" Height="24" Grid.Column="1" Grid.Row="4" TabIndex="4"></sdk:DatePicker>
            <TextBlock Text="Definition #" x:Name="lblDef" Grid.Row="1" FontSize="12" Foreground="White" VerticalAlignment="Center" Margin="30,6,7,6"></TextBlock>
            <TextBlock Text="Description"  Grid.Row="2" FontSize="12" Foreground="White" VerticalAlignment="Center" Margin="30,6,7,6"></TextBlock>
            <TextBlock Text="Is Basic ?" Grid.Row="5" FontSize="12" Foreground="White" VerticalAlignment="Center" Margin="30,6,7,6"></TextBlock>
            <TextBlock Text="Effective Date"  Grid.Row="3" FontSize="12" Foreground="White" VerticalAlignment="Center" Margin="30,6,7,6"></TextBlock>
            <TextBlock Text="End Date"  Grid.Row="4" FontSize="12" Foreground="White" VerticalAlignment="Center" Margin="30,6,7,6"></TextBlock>
            <TextBlock Text="Active" Foreground="White" Grid.Row="6" VerticalAlignment="Center" FontSize="12" Margin="29,6,7,6"></TextBlock>
            <Button x:Name="btnSave" Content="Save" Click="btnSave_Click" Style="{StaticResource GlassButton}" Grid.Row="8" Width="75" Foreground="White" Height="24" Margin="123,3,2,3" TabIndex="7"></Button>
            <Button x:Name="btnCancel" Click="btnCancel_Click" Content="Cancel" Style="{StaticResource GlassButton}" Grid.Row="8" Width="75" Foreground="White" Height="24" Margin="6,3,119,3" Grid.Column="1" TabIndex="8"></Button>
            <Button x:Name="btnExit" Content="Exit" Click="btnExit_Click" Style="{StaticResource GlassButton}" Visibility="Collapsed" Grid.Column="0" Grid.Row="8" Width="75" Foreground="White" Height="24" Margin="123,0,0,0" TabIndex="7"></Button>

            <Button x:Name="btnPrint" Content="print" Click="btnPrint_Click" Style="{StaticResource GlassButton}" Visibility="Visible" Grid.Column="0" Grid.Row="8" Width="75" Foreground="White" Height="24" Margin="-123,0,0,0" TabIndex="7"></Button>
        </Grid>

    </Grid>
</UserControl>


Answers (2)