Serialization

7 posts, 0 answers
  1. Parameswari
    Parameswari avatar
    19 posts
    Member since:
    Jun 2011

    Posted 23 Jul 2011 Link to this post

    Hi,

    In our project we have to process the following:
    1.we have to save the controls(Textbox,Combobox,label..)in the form using serialization into xaml or xml string
    2.We have to allow the client to move the fields in the form so that the client can modify the form according to thier needs & save it .And retrieve the same when required.
    All these to done using serialization.
    Pls help us to solve this issue.
    Thanks
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 24 Jul 2011 Link to this post

    Hello Parameswari,

    Can you please explain, how is this question particularly related to Telerik controls?

    All the best,
    Ross
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. Parameswari
    Parameswari avatar
    19 posts
    Member since:
    Jun 2011

    Posted 02 Aug 2011 Link to this post

    Hi Ross,
        Sorry for delay. Here is my problem -  We are creating a  Accounting Software using Telerik Tools. At one point we need to move the position of columns and grid & enable and disable the columns  at  Runtime as client requirement . After changing the view the form should be stored and retreived when required & default form design should be also available .  We have written code for changing the design .It works fine . For saving only we are thinking for serialize the whole form   & convert it into Xaml String . And store it in some location & retreive . My question is:
      1.  Is there  any way to serialize the whole form state instead of serializing each controls seperately?    
    If not specify other methods to do this process.
      2. After converting to xaml(or xml) ,where we can save it whether in database ? If can ,How?
                                    I dont have any idea of serialization  .Pls provide me with detail document

    In our xaml we are using RadGrid,RadDocking etc..,
    I have sent my  wholoe xaml code just to  make  clear what all controls we are using in our design  .Pls check it.
    <UserControl x:Class="BusinessAccounting.View.Invoice.Invoice"
        mc:Ignorable="d"
        d:DesignHeight="600" d:DesignWidth="1060"
                 xmlns:telerikRibbonBar="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.RibbonBar"
                 xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
                 xmlns:TelerikDocking="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking"
                 xmlns:TelerikCombo="http://schemas.telerik.com/2008/xaml/presentation"
                 xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
                 xmlns:TelerikGrid="http://schemas.telerik.com/2008/xaml/presentation"
                 xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
                 xmlns:System="clr-namespace:System;assembly=mscorlib"
                 xmlns:Telerik_Windows_Controls_Chromes="clr-namespace:Telerik.Windows.Controls.Chromes;assembly=Telerik.Windows.Controls"
                 xmlns:TelerikPopup="http://schemas.telerik.com/2008/xaml/presentation" 
                 xmlns:Sty="clr-namespace:Telerik.Windows.Controls.Animation;assembly=Telerik.Windows.Controls"
                 xmlns:GridViewFooter="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"
                 xmlns:Icons="clr-namespace:BusinessAccounting.ViewModel.Common">
      
        <UserControl.Resources>
            <Icons:IconViewModel x:Key="iconviewmodel" />
            <!--<data:InvoiceContainer x:Key="Inv" />-->
      
            <Style TargetType="GridViewFooter:GridViewFooterCell">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Border BorderBrush="LightGray" BorderThickness="0,0,1,0" >
                                <Button x:Name="Btn_AddEmptyRow" Opacity="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Command="{Binding AddEmptyRowCommand, Source={StaticResource invoiceViewModel}}"/>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="Background" Value="Transparent"/>
            </Style>
            <Style TargetType="GridViewFooter:GridViewFooterRow">
                <Setter Property="MinHeight" Value="19"/>
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="BorderThickness" Value="0,0,0,0"/>
            </Style>
      
            <SolidColorBrush x:Key="ButtonIconBackground_Normal" Color="#FFFFFFFF"/>
            <SolidColorBrush x:Key="ButtonIconForeground_Normal" Color="#FF000000"/>
            <SolidColorBrush x:Key="PickerPopupBackground" Color="#FFFFFFFF"/>
            <SolidColorBrush x:Key="ButtonIconForeground_Disabled" Color="#FF8D8D8D"/>
            <SolidColorBrush x:Key="ButtonIconBackground_Disabled" Color="#FFFFFFFF"/>
            <SolidColorBrush x:Key="ButtonIconForeground_MouseOver" Color="#FF000000"/>
            <SolidColorBrush x:Key="ButtonIconBackground_MouseOver" Color="#FFFFFFFF"/>
            <SolidColorBrush x:Key="ButtonIconForeground_Pressed" Color="#FF000000"/>
            <SolidColorBrush x:Key="ButtonIconBackground_Pressed" Color="#FFFFFFFF"/>
            <SolidColorBrush x:Key="AddNewRow" Color="#FFFFFFFF"/>
            <SolidColorBrush x:Key="PickerBackground_Normal" Color="#FFFFFFFF"/>
            <SolidColorBrush x:Key="ControlOuterBorder_MouseOver" Color="#FFFFC92B"/>
            <SolidColorBrush x:Key="ControlOuterBorder_Focused" Color="#FFFFC92B"/>
            <SolidColorBrush x:Key="ControlInnerBorder_Focused" Color="Transparent"/>
            <SolidColorBrush x:Key="ControlOuterBorder_Disabled" Color="#FF989898"/>
              
            <!--Combo box Control Disabled ForeGround colour-->
            <!--<SolidColorBrush x:Key="PickerForeground_Disabled" Color="#FF8D8D8D"/>-->
            <SolidColorBrush x:Key="PickerForeground_Disabled" Color="Black"/>
      
            <!--combo box Control Disabled background colour-->
            <SolidColorBrush x:Key="ControlBackground_Disabled" Color="White"/>
      
            <CornerRadius x:Key="SplitButton_SpanCornerRadius">1</CornerRadius>
            <CornerRadius x:Key="SplitButton_LeftPartCornerRadius">1 0 0 1</CornerRadius>
            <CornerRadius x:Key="SplitButton_SpanInnerCornerRadius">0</CornerRadius>
            <CornerRadius x:Key="SplitButton_RightPartCornerRadius">0 1 1 0</CornerRadius>
      
            <LinearGradientBrush x:Key="ControlOuterBorder_Pressed" EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF282828"/>
                <GradientStop Color="#FF5F5F5F" Offset="1"/>
            </LinearGradientBrush>
      
            <ControlTemplate x:Key="ArrowTemplateEditableCombobox" TargetType="ContentControl">
                <Grid Margin="5 0">
                    <Path x:Name="BackgroundIcon" Data="M0,0 L2,0 1,1 Z" Fill="{TemplateBinding Background}" Height="3" Margin="0 2 0 0" Stretch="Fill" Width="5"/>
                    <Path x:Name="ForegroundIcon" Data="M0,0 L2,0 1,1 Z" Fill="{TemplateBinding Foreground}" Height="3" Margin="0 1 0 1" Stretch="Fill" Width="5"/>
                </Grid>
            </ControlTemplate>
      
            <ControlTemplate x:Key="EditableComboBox" TargetType="telerikInput:RadComboBox">
                <Grid x:Name="VisualRoot">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <VisualStateManager.VisualStateGroups>
                          
                        <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Disabled">
                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Border">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource ControlOuterBorder_Disabled}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual">
                                        <LinearDoubleKeyFrame KeyTime="0:0:0.050" Value="0"/>
                                    </DoubleAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="MouseOverVisual">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0.050">
                                            <DiscreteObjectKeyFrame.Value>
                                                <Visibility>Collapsed</Visibility>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="PART_EditableTextBox">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource PickerForeground_Disabled}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="DropDownIcon">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconForeground_Disabled}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="DropDownIcon">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconBackground_Disabled}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Background">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlBackground_Disabled}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Normal">
                                <Storyboard>
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual">
                                        <LinearDoubleKeyFrame KeyTime="0:0:0.150" Value="0"/>
                                    </DoubleAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="MouseOverVisual">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0.150">
                                            <DiscreteObjectKeyFrame.Value>
                                                <Visibility>Collapsed</Visibility>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="MouseOver">
                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RenderActive" Storyboard.TargetName="ButtonChrome">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                            <DiscreteObjectKeyFrame.Value>
                                                <System:Boolean>True</System:Boolean>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual">
                                        <LinearDoubleKeyFrame KeyTime="0:0:0.115" Value="1"/>
                                    </DoubleAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="MouseOverVisual">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                            <DiscreteObjectKeyFrame.Value>
                                                <Visibility>Visible</Visibility>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="DropDownIcon">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconForeground_MouseOver}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="DropDownIcon">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconBackground_MouseOver}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="DropDownOpen">
                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Border">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{StaticResource ControlOuterBorder_Pressed}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual">
                                        <LinearDoubleKeyFrame KeyTime="0:0:0.050" Value="0"/>
                                    </DoubleAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="MouseOverVisual">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0.050">
                                            <DiscreteObjectKeyFrame.Value>
                                                <Visibility>Collapsed</Visibility>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisual">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="0"/>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="DropDownIcon">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconForeground_Pressed}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="DropDownIcon">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconBackground_Pressed}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                        </VisualStateGroup>
                          
                        <VisualStateGroup x:Name="FocusStates">
                            <VisualState x:Name="Focused">
                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="RenderFocused" Storyboard.TargetName="ButtonChrome">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                            <DiscreteObjectKeyFrame.Value>
                                                <System:Boolean>True</System:Boolean>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="FocusVisual">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                            <DiscreteObjectKeyFrame.Value>
                                                <Visibility>Visible</Visibility>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Unfocused"/>
                        </VisualStateGroup>
                          
                        <VisualStateGroup x:Name="ValidationStates">
                            <VisualState x:Name="Valid"/>
                            <VisualState x:Name="InvalidUnfocused">
                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationTooltip">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                            <DiscreteObjectKeyFrame.Value>
                                                <Visibility>Visible</Visibility>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="InvalidFocused">
                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationTooltip">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                            <DiscreteObjectKeyFrame.Value>
                                                <Visibility>Visible</Visibility>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen" Storyboard.TargetName="ValidationTooltip">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                            <DiscreteObjectKeyFrame.Value>
                                                <System:Boolean>True</System:Boolean>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                        </VisualStateGroup>
                          
                        <VisualStateGroup x:Name="WatermarkStates">
                            <VisualState x:Name="WatermarkVisible">
                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Watermark">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                            <DiscreteObjectKeyFrame.Value>
                                                <Visibility>Visible</Visibility>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="WatermarkInvisible"/>
                        </VisualStateGroup>
                          
                    </VisualStateManager.VisualStateGroups>
                    <Border x:Name="Background" Background="{StaticResource PickerBackground_Normal}" Grid.Column="0" CornerRadius="{StaticResource SplitButton_LeftPartCornerRadius}" IsHitTestVisible="False"/>
                    <Border Background="{TemplateBinding Background}" Grid.ColumnSpan="2" CornerRadius="{StaticResource SplitButton_SpanCornerRadius}" IsHitTestVisible="False"/>
                    <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="{StaticResource SplitButton_SpanCornerRadius}" IsHitTestVisible="False"/>
                    <Border x:Name="MouseOverVisual" BorderBrush="{StaticResource ControlOuterBorder_MouseOver}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="{StaticResource SplitButton_SpanCornerRadius}" IsHitTestVisible="False" Opacity="0" Visibility="Collapsed"/>
                    <telerik:PickerTextBox x:Name="PART_EditableTextBox" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="0" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsReadOnly="{TemplateBinding IsReadOnly}" Padding="{TemplateBinding Padding}" telerik:StyleManager.Theme="{StaticResource Theme}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    <Border x:Name="FocusVisual" BorderBrush="{StaticResource ControlOuterBorder_Focused}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="{StaticResource SplitButton_SpanCornerRadius}" IsHitTestVisible="False" Visibility="Collapsed">
                        <Border BorderBrush="{StaticResource ControlInnerBorder_Focused}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource SplitButton_SpanInnerCornerRadius}"/>
                    </Border>
                    <telerik:RadToggleButton x:Name="PART_DropDownButton" ClickMode="Press" Grid.Column="1" IsTabStop="False" Margin="0" Padding="0">
                        <telerik:RadToggleButton.Template>
                            <ControlTemplate TargetType="telerik:RadToggleButton">
                                <ContentPresenter/>
                            </ControlTemplate>
                        </telerik:RadToggleButton.Template>
                        <Grid>
                            <Telerik_Windows_Controls_Chromes:ButtonChrome x:Name="ButtonChrome" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource SplitButton_RightPartCornerRadius}" RenderMouseOver="{Binding IsMouseOver, ElementName=PART_DropDownButton}" RenderPressed="{TemplateBinding IsDropDownOpen}" RenderFocused="{TemplateBinding IsFocused}" RenderEnabled="{TemplateBinding IsEnabled}" telerik:StyleManager.Theme="{StaticResource Theme}"/>
                            <ContentControl x:Name="DropDownIcon" Background="{StaticResource ButtonIconBackground_Normal}" Grid.Column="1" Foreground="{StaticResource ButtonIconForeground_Normal}" IsTabStop="False" Template="{StaticResource ArrowTemplateEditableCombobox}"/>
                        </Grid>
                    </telerik:RadToggleButton>
                    <TextBlock x:Name="Watermark" HorizontalAlignment="Left" IsHitTestVisible="False" Margin="5,0,0,0" Opacity=".5" Text="{TemplateBinding EmptyText}" Visibility="Collapsed" VerticalAlignment="Center"/>
                    <Telerik_Windows_Controls_Chromes:ValidationTooltip x:Name="ValidationTooltip" Grid.ColumnSpan="2" TooltipPlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" telerik:StyleManager.Theme="{StaticResource Theme}" TooltipContent="{Binding (Validation.Errors), RelativeSource={RelativeSource TemplatedParent}}" Visibility="Collapsed"/>
      
                    <TelerikPopup:Popup CloseOnOutsideClick="True" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Owner="{Binding RelativeSource={RelativeSource TemplatedParent}}">
      
                        <Grid x:Name="PopupRoot">
                            <Telerik_Windows_Controls_Chromes:ShadowChrome Margin="0 0 0 3" telerik:StyleManager.Theme="{StaticResource Theme}"/>
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{StaticResource PickerPopupBackground}" CornerRadius="{StaticResource SplitButton_SpanCornerRadius}" MaxHeight="{TemplateBinding MaxDropDownHeight}" Margin="0 0 0 3" MinWidth="{TemplateBinding MinDropDownWidth}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
      
                                    <!--Add New Record Button-->
                                    <telerik:RadButton x:Name="PART_ClearButton" Margin="-1 -1 -1 0" Grid.Row="0" 
                                                       Background="{StaticResource AddNewRow}" Tag="{TemplateBinding Tag}"
                                                       Visibility="{TemplateBinding ClearSelectionButtonVisibility}" 
                                                       >
                                        <telerik:RadButton.Content>
                                            <TextBlock Text="{TemplateBinding ClearSelectionButtonContent}" Width="Auto" HorizontalAlignment="Left" Margin="-80,0,0,0"/>
                                        </telerik:RadButton.Content>
                                    </telerik:RadButton>
      
                                    <ScrollViewer x:Name="PART_ScrollViewer" BorderThickness="0" telerik:ScrollViewerExtensions.EnableMouseWheel="True" Padding="1 1 1 0" Grid.Row="1" telerik:StyleManager.Theme="{StaticResource Theme}" VerticalScrollBarVisibility="Auto">
                                        <ItemsPresenter/>
                                    </ScrollViewer>
                                </Grid>
                            </Border>
                        </Grid>
                    </TelerikPopup:Popup>
                </Grid>
            </ControlTemplate>
      
            <Style x:Key="RadComboBoxStyle" TargetType="telerikInput:RadComboBox">
                <Setter Property="Template" Value="{StaticResource EditableComboBox}"/>
                <Setter Property="EditableTemplate" Value="{StaticResource EditableComboBox}"/>
                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                <Setter Property="VerticalContentAlignment" Value="Center"/>
                <Setter Property="MinHeight" Value="22"/>
                <Setter Property="Padding" Value="5 0"/>
                <!--<Setter Property="Foreground" Value="{StaticResource PickerForeground_Normal}"/>-->
                <Setter Property="Background" Value="Transparent"/>
                <!--<Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Normal}"/>-->
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="UseLayoutRounding" Value="True"/>
      
                <Setter Property="Sty:AnimationManager.AnimationSelector">
                    <Setter.Value>
                        <Sty:AnimationSelector>
                            <Sty:AnimationGroup AnimationName="Expand">
                                <Sty:SlideAnimation Direction="In" SlideMode="Top"  TargetElementName="PopupRoot"/>
                            </Sty:AnimationGroup>
                            <Sty:AnimationGroup AnimationName="Collapse">
                                <Sty:SlideAnimation Direction="Out" SlideMode="Top" TargetElementName="PopupRoot"/>
                            </Sty:AnimationGroup>
                        </Sty:AnimationSelector>
                    </Setter.Value>
                </Setter>
            </Style>
      
        </UserControl.Resources>
      
        <Grid x:Name="grdLayoutRoot" ShowGridLines="False"  Height="Auto" Margin="0,0,0,0" Background="#FFBFDBFF">
            <!--Background="#FFD5E4F2"-->
      
            <Grid.RowDefinitions >
                <RowDefinition Height="98"/>
                <RowDefinition Height="19"/>
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions >
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
      
            <telerikRibbonBar:RadRibbonBar x:Name="Rib_Menu" Grid.Row="0" Grid.Column="0" Height="98"  ApplicationName="Business Accounting - Invoice" SelectedTabChanged="Rib_Menu_SelectedTabChanged">
                <telerikRibbonBar:RadRibbonBar.ApplicationMenu >
                    <telerikRibbonBar:ApplicationMenu>
                        <!-- set the content in right pane -->
                        <telerikRibbonBar:ApplicationMenu.Content>
                            <StackPanel Width="250">
                                <telerikRibbonBar:RadGroupHeader Content="Recent Files"/>
                            </StackPanel>
                        </telerikRibbonBar:ApplicationMenu.Content>
                        <!-- set the content in footer -->
                        <telerikRibbonBar:ApplicationMenu.FooterContent>
                            <StackPanel Orientation="Horizontal">
                                <telerikRibbonBar:RadRibbonButton Content="Options"/>
                                <telerikRibbonBar:RadRibbonButton Content="Exit"/>
                            </StackPanel>
                        </telerikRibbonBar:ApplicationMenu.FooterContent>
                        <telerikRibbonBar:RadRibbonButton LargeImage="save.png" Text="Save"/>
                        <telerikRibbonBar:RadRibbonSplitButton LargeImage="saveas.png" Text="Save as ...">
                            <telerikRibbonBar:RadRibbonSplitButton.DropDownContent>
                                <StackPanel>
                                    <telerikRibbonBar:RadRibbonButton Content="PDF"/>
                                    <telerikRibbonBar:RadRibbonButton Content="Html Page"/>
                                </StackPanel>
                            </telerikRibbonBar:RadRibbonSplitButton.DropDownContent>
                        </telerikRibbonBar:RadRibbonSplitButton>
                    </telerikRibbonBar:ApplicationMenu>
                </telerikRibbonBar:RadRibbonBar.ApplicationMenu>
                <telerikRibbonBar:RadRibbonTab Header="File" VerticalAlignment="Top" Height="46" x:Name="Tab_File" IsSelected="True" >
                    <!--<telerikRibbonBar:RadRibbonGroup Header="New" Visibility="Collapsed">
                        <telerikRibbonBar:RadRibbonButton  x:Name="Btn_New" >
                            <telerikRibbonBar:RadRibbonButton.Content >
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="../../Icons/application_add.png" Width="16" Height="16" />
                                </StackPanel>
                            </telerikRibbonBar:RadRibbonButton.Content>
                        </telerikRibbonBar:RadRibbonButton>
                    </telerikRibbonBar:RadRibbonGroup>-->
                    <telerikRibbonBar:RadRibbonGroup Header="Save">
                        <telerikRibbonBar:RadRibbonButton x:Name="SaveNew"  Command="{Binding SaveCommand}"  CommandParameter="New">
                            <telerikRibbonBar:RadRibbonButton.Content>
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="{Binding Source={StaticResource iconviewmodel}, Path=Save}" Width="16" Height="16" />
                                    <TextBlock Text="Save and New" Margin="2,0,0,0"/>
                                </StackPanel>
                            </telerikRibbonBar:RadRibbonButton.Content>
                        </telerikRibbonBar:RadRibbonButton>
                        <telerikRibbonBar:RadRibbonButton x:Name="SaveClose" Command="{Binding SaveCommand}" >
                            <telerikRibbonBar:RadRibbonButton.Content >
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="{Binding Source={StaticResource iconviewmodel}, Path=Save}" Width="16" Height="16" />
                                    <TextBlock Text="Save and Close" Margin="2,0,0,0"/>
                                </StackPanel>
                            </telerikRibbonBar:RadRibbonButton.Content>
                        </telerikRibbonBar:RadRibbonButton>
                    </telerikRibbonBar:RadRibbonGroup>
                    <telerikRibbonBar:RadRibbonGroup  Header="Edit" >
                        <telerikRibbonBar:RadRibbonButton x:Name="Btn_Edit" Command="{Binding InvoiceCommand}" CommandParameter="Edit" >
                            <telerikRibbonBar:RadRibbonButton.Content >
                                <StackPanel >
                                    <Image Source="{Binding Source={StaticResource iconviewmodel}, Path=Edit}" Width="16" Height="16" />
                                </StackPanel>
                            </telerikRibbonBar:RadRibbonButton.Content>
                        </telerikRibbonBar:RadRibbonButton>
                    </telerikRibbonBar:RadRibbonGroup>
                    <telerikRibbonBar:RadRibbonGroup  Header="Delete" >
                        <telerikRibbonBar:RadRibbonButton  Width="25" x:Name="btnDelete" Command="{Binding DeleteCommand}">
                            <telerikRibbonBar:RadRibbonButton.Content>
                                <StackPanel>
                                    <Image Source="{Binding Source={StaticResource iconviewmodel}, Path=Delete}" Width="16" Height="16" />
                                </StackPanel>
                            </telerikRibbonBar:RadRibbonButton.Content>
                        </telerikRibbonBar:RadRibbonButton>
                    </telerikRibbonBar:RadRibbonGroup>
      
                    <telerikRibbonBar:RadRibbonGroup  Header="Printing" >
                        <telerikRibbonBar:RadRibbonButton  x:Name="Btn_Print" >
                            <telerikRibbonBar:RadRibbonButton.Content >
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="{Binding Source={StaticResource iconviewmodel}, Path=Printer}" Width="16" Height="16" />
                                    <TextBlock Text="Print" Margin="2,0,0,0"/>
                                </StackPanel>
                            </telerikRibbonBar:RadRibbonButton.Content>
                        </telerikRibbonBar:RadRibbonButton>
                        <telerikRibbonBar:RadRibbonButton x:Name="Btn_PrintPreview" Command="{Binding PrintCommand}">
                            <telerikRibbonBar:RadRibbonButton.Content >
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="{Binding Source={StaticResource iconviewmodel}, Path=PrintPreview}" Width="16" Height="16" />
                                    <TextBlock Text="Print Preview" Margin="2,0,0,0"/>
                                </StackPanel>
                            </telerikRibbonBar:RadRibbonButton.Content>
                        </telerikRibbonBar:RadRibbonButton>
                    </telerikRibbonBar:RadRibbonGroup>
                    <telerikRibbonBar:RadRibbonGroup  Header="Close" >
                        <telerikRibbonBar:RadRibbonButton x:Name="Btn_Close" Size="Large" Command="{Binding CloseCommand}" >
                            <telerikRibbonBar:RadRibbonButton.Content>
                                <StackPanel>
                                    <Image Source="{Binding Source={StaticResource iconviewmodel}, Path=Close}" Width="16" Height="16"/>
                                </StackPanel>
                            </telerikRibbonBar:RadRibbonButton.Content>
                        </telerikRibbonBar:RadRibbonButton>
                    </telerikRibbonBar:RadRibbonGroup>
      
                </telerikRibbonBar:RadRibbonTab>
                <telerikRibbonBar:RadRibbonTab Header="Edit" x:Name="Tab_Edit">
                </telerikRibbonBar:RadRibbonTab>
                <telerikRibbonBar:RadRibbonTab Header="View" x:Name="Tab_View">
                </telerikRibbonBar:RadRibbonTab>
                <telerikRibbonBar:RadRibbonTab Header="Actions" x:Name="Tab_Actions" >
      
      
                </telerikRibbonBar:RadRibbonTab>
                <telerikRibbonBar:RadRibbonTab Header="CreditData" x:Name="Tab_CreditData">
                </telerikRibbonBar:RadRibbonTab>
                <telerikRibbonBar:RadRibbonTab Header="Help" x:Name="Tab_Help">
                </telerikRibbonBar:RadRibbonTab>
      
      
                <telerikRibbonBar:RadRibbonTab Header="Screen Designer" VerticalAlignment="Top" x:Name="Tab_Template"  >
      
                    <telerikRibbonBar:RadRibbonGroup Header="Reset Screen"  >
                        <telerikRibbonBar:RadRibbonButton x:Name="Btn_ResetTemplate" Command="{Binding ResetTemplateCommand}" >
                            <telerikRibbonBar:RadRibbonButton.Content >
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="./Images/Reset.png" Width="16" Height="16" />
                                    <TextBlock Text="Reset" Margin="2,0,0,0"/>
                                </StackPanel>
                            </telerikRibbonBar:RadRibbonButton.Content>
                        </telerikRibbonBar:RadRibbonButton>
                    </telerikRibbonBar:RadRibbonGroup>
      
                    <telerikRibbonBar:RadRibbonGroup Header="Save Template">
                        <telerikRibbonBar:RadRibbonButton x:Name="Btn_SaveTemplate" Command="{Binding SaveTemplateCommand}" >
                            <telerikRibbonBar:RadRibbonButton.Content >
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="{Binding Source={StaticResource iconviewmodel}, Path=Save}" Width="16" Height="16" />
                                    <TextBlock Text="Save" Margin="2,0,0,0"/>
                                </StackPanel>
                            </telerikRibbonBar:RadRibbonButton.Content>
                        </telerikRibbonBar:RadRibbonButton>
                    </telerikRibbonBar:RadRibbonGroup>
      
                    <telerikRibbonBar:RadRibbonGroup Header="Templates">
                        
                        <telerikRibbonBar:RadRibbonComboBox x:Name="Cmb_ScreenTemplates" Width="150"  SelectionChanged="Cmb_ScreenTemplates_SelectionChanged"  
                                 ItemsSource="{Binding ScreenTemplate}"
                        DisplayMemberPath = "{Binding STL_TemplateName}"
                        SelectedValuePath = "STL_TemplateID"
                     SelectedItem ="{Binding SelectedTemplate}">
                                 
                        </telerikRibbonBar:RadRibbonComboBox>
                    </telerikRibbonBar:RadRibbonGroup>
      
                </telerikRibbonBar:RadRibbonTab>
                  
                  
            </telerikRibbonBar:RadRibbonBar>
      
            <StackPanel x:Name="Stk_LblInvoice" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left">
                <TextBlock x:Name="Lbl_Invoice" Text="Invoice (Not Paid)" FontSize="13" FontWeight="SemiBold" Margin="5,0,0,0" VerticalAlignment="Bottom" Foreground="#FF3764A0"/>
            </StackPanel>
            <StackPanel Grid.Row="1"  Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,5,0">
                <telerikInput:RadDatePicker  x:Name="Dt_CurrDt"   Width="100" MinHeight="15" Height="19" FontSize="9.5" VerticalAlignment="Center"
                                             SelectedValue="{Binding Path=CurrentInvoice.TransactionDateTime, Mode=TwoWay}"/>
                <TextBlock Text=" No " VerticalAlignment="Bottom"/>
                <TextBox x:Name="Txt_DDNo" Width="80" Height="19" FontSize="10" VerticalAlignment="Center" Padding="0"
                         Text="{Binding Path=CurrentInvoice.SalesHeaderID, Mode=TwoWay}"/>
            </StackPanel>
      
            <TelerikDocking:RadDocking x:Name="Doc_Pane" Grid.Row="2" Grid.Column="0" BorderThickness="0" >
                <TelerikDocking:RadDocking.DocumentHost>
                    <ScrollViewer x:Name="Scr_Pane" Grid.Row="2" Grid.Column="0" ScrollViewer.VerticalScrollBarVisibility="Auto"  BorderThickness="0" Margin="0" >
                        <Grid x:Name="MainControlLayout" Grid.Row="2" Grid.Column="0"  ShowGridLines="False" >
                            <Grid.Resources>
                                <DataTemplate x:Key="ComboBoxCustomerNameTemplate">
                                    <Grid Margin="1,1,1,1" Width="Auto">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding CustomerID}" MinWidth="25" Width="Auto"/>
                                        <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding CustomerName}" MinWidth="125" Width="Auto" />
                                    </Grid>
                                </DataTemplate>
                                <DataTemplate x:Key="ComboBoxAddressTemplate">
                                    <Grid Margin="1,1,1,1" Width="Auto">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        <TextBlock x:Name="Txt_DispAddr" Grid.Row="0" Grid.Column="0" Width="256" >
                                    <Run Text="{Binding AddressType.AddressTypeName}" FontWeight="Bold" Foreground="#FF3764A0"/>
                                    <Run Text=":" FontWeight="Bold" Foreground="#FF3764A0"/>
                                    <LineBreak />
                                    <Run Text="{Binding Address1}"/>
                                    <Run Text=", "/>
                                    <Run Text="{Binding Address2}"/>
                                    <LineBreak />
                                    <Run Text="{Binding City}"/>
                                    <Run Text=", "/>
                                    <Run Text="{Binding State}"/>
                                    <Run Text=" "/>
                                    <Run Text="{Binding Zip}"/>
                                    <LineBreak />
                                    <Run Text="{Binding Country.CountryName}"/>
                                        </TextBlock>
                                        <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding AddressID}" Width="0"/>
                                    </Grid>
                                </DataTemplate>
                                <DataTemplate x:Key="ComboBoxSelectedAddressTemplate">
                                    <Grid Margin="1,1,1,1" Width="400">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        <TextBlock Grid.Row="0" Grid.Column="0"  Width="400">
                                    <Run Text="{Binding Address1}"/>
                                    <Run Text=", "/>
                                    <Run Text="{Binding Address2}"/>
                                    <LineBreak />
                                    <Run Text="{Binding City}"/>
                                    <Run Text=", "/>
                                    <Run Text="{Binding State}"/>
                                    <Run Text=" "/>
                                    <Run Text="{Binding Zip}"/>
                                    <LineBreak />
                                    <Run Text="{Binding Country.CountryName}"/>
                                        </TextBlock>
                                        <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding AddressID}" Width="0"/>
                                    </Grid>
                                </DataTemplate>
                                <DataTemplate x:Key="ComboBoxShippingMethodTemplate">
                                    <Grid Margin="1,1,1,1" Width="Auto">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding ShippingMethodName}" MinWidth="100" Width="Auto" />
                                        <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding ShippingMethodDescription}" MinWidth="125" Width="Auto" />
                                        <TextBlock Grid.Row="0" Grid.Column="2" Text="{Binding ShippingMethodID}" Width="0"/>
                                    </Grid>
                                </DataTemplate>
                                <DataTemplate x:Key="ComboBoxSalesPersonTemplate">
                                    <Grid Margin="1,1,1,1" Width="Auto">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding EmployeeID}" Width="Auto" MinWidth="25"/>
                                        <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding NameDetailName}" Width="Auto" MinWidth="125"/>
                                        <TextBlock Grid.Row="0" Grid.Column="2" Text="{Binding JobTitle}" Width="Auto" MinWidth="125"/>
                                    </Grid>
                                </DataTemplate>
                                <DataTemplate x:Key="ComboBoxJobNameTemplate">
                                    <Grid Margin="1,1,1,1" Width="Auto">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding JobName}" Width="Auto" MinWidth="100"/>
                                        <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Customer.CustomerName}" Width="Auto" MinWidth="125"/>
                                        <TextBlock Grid.Row="0" Grid.Column="2" Text="{Binding JobID}" Width="Auto" MinWidth="25"/>
                                    </Grid>
                                </DataTemplate>
                                <DataTemplate x:Key="ComboBoxPaymentTermTemplate">
                                    <Grid Margin="1,1,1,1" Width="Auto">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding PaymentTermName}" Width="Auto" MinWidth="100"/>
                                        <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding PaymentTermDescription}" Width="Auto" MinWidth="125"/>
                                        <TextBlock Grid.Row="0" Grid.Column="2" Text="{Binding PaymentTermID}" Width="0"/>
                                    </Grid>
                                </DataTemplate>
                                <DataTemplate x:Key="ComboBoxShippingTermTemplate">
                                    <Grid Margin="1,1,1,1" Width="Auto">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding ShippingTermName}" Width="Auto" MinWidth="100"/>
                                        <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding ShippingTermDescription}" Width="Auto" MinWidth="125"/>
                                        <TextBlock Grid.Row="0" Grid.Column="2" Text="{Binding ShippingTermID}" Width="0"/>
                                    </Grid>
                                </DataTemplate>
                                <DataTemplate x:Key="ComboBoxPriceLevelTemplate">
                                    <Grid Margin="1,1,1,1" Width="Auto">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding PriceLevelName}" Width="Auto" MinWidth="125"/>
                                        <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Percentage}" Width="Auto" MinWidth="25"/>
                                        <TextBlock Grid.Row="0" Grid.Column="2" Text="{Binding PriceLevelID}" Width="0"/>
                                    </Grid>
                                </DataTemplate>
                                <DataTemplate x:Key="ComboBoxClassTemplate">
                                    <Grid Margin="1,1,1,1" Width="Auto">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding ClassName}" Width="Auto" MinWidth="100"/>
                                        <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding ClassDescription}" Width="Auto" MinWidth="125"/>
                                        <TextBlock Grid.Row="0" Grid.Column="2" Text="{Binding ClassID}" Width="0"/>
                                    </Grid>
                                </DataTemplate>
                            </Grid.Resources>
                            <Grid.RowDefinitions >
                                <RowDefinition MinHeight="20" Height="Auto"/>
                                <RowDefinition MinHeight="20" Height="Auto"/>
                                <RowDefinition MinHeight="20" Height="Auto"/>
                                <RowDefinition MinHeight="20" Height="Auto"/>
                                <RowDefinition MinHeight="20" Height="Auto"/>
                                <RowDefinition MinHeight="20" Height="Auto"/>
                                <RowDefinition MinHeight="20" Height="Auto"/>
                                <RowDefinition MinHeight="20" Height="Auto"/>
                                <RowDefinition MinHeight="20" Height="Auto"/>
                                <RowDefinition MinHeight="20" Height="Auto"/>
                                <RowDefinition MinHeight="20" Height="Auto"/>
                                <RowDefinition Height="9*" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions >
                                <ColumnDefinition Width="38"/>
                                <ColumnDefinition Width="74" />
                                <ColumnDefinition />
                                <ColumnDefinition Width="112"/>
                                <ColumnDefinition />
                                <ColumnDefinition Width="112"/>
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
      
                            <TextBlock x:Name="Lbl_Customer" Text="Customer" FontWeight="Normal" FontSize="10.667" VerticalAlignment="Top" Margin="5,0,0,0" HorizontalAlignment="Left" Width="107" Grid.ColumnSpan="2" />
                            <TelerikCombo:RadComboBox x:Name="Cmb_Customer" Grid.Column="2"
                                      MinHeight="15" Height="19"
                                      VerticalAlignment="Top" TabIndex="1" IsEditable="True"
                                      IsTextSearchEnabled="True"
                                      telerik:TextSearch.TextPath="CustomerName"
                                      SelectedValuePath="CustomerID" Style="{StaticResource RadComboBoxStyle}"
                                      SelectedItem="{Binding SelectedCustomer, Mode=TwoWay}"
                                      SelectedValue="{Binding CurrentInvoice.CustomerID, Mode=TwoWay}"
                                      ItemTemplate="{StaticResource ComboBoxCustomerNameTemplate}"      
                                      ItemsSource="{Binding Customers}"
                                      ClearSelectionButtonVisibility="Visible" 
                                      ClearSelectionButtonContent="Add new customer...">
      
                                <TelerikCombo:RadComboBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <VirtualizingStackPanel />
                                    </ItemsPanelTemplate>
                                </TelerikCombo:RadComboBox.ItemsPanel>
      
                            </TelerikCombo:RadComboBox>
                            <Border x:Name="Bdr_Customer" Grid.ColumnSpan="3" BorderThickness="1" VerticalAlignment="Top" Height="19"/>
                              
                            <TextBlock x:Name="Lbl_BillTo" Text="Bill To" Grid.Row="1" Grid.RowSpan="3" FontWeight="Normal" FontSize="10.667" VerticalAlignment="Top" Margin="5,0,0,0" Height="59" Grid.ColumnSpan="2" />
                            <TelerikCombo:RadComboBox x:Name="Cmb_BillTo" 
                                      Grid.Row="1" Grid.Column="2" Grid.RowSpan="3" 
                                      Height="59" Padding="4" TabIndex="2" VerticalAlignment="Top" 
                                      SelectedValuePath="AddressID"
                                      ItemTemplate="{StaticResource ComboBoxAddressTemplate}" 
                                      SelectionBoxTemplate="{StaticResource ComboBoxSelectedAddressTemplate}" 
                                      telerik:TextSearch.TextPath="Address1" 
                                      ItemsSource="{Binding SelectedCustomer.Addresses, Mode=TwoWay}"
                                      SelectedValue="{Binding CurrentInvoice.BillToAddressID, Mode=TwoWay}">
      
                                <TelerikCombo:RadComboBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <VirtualizingStackPanel />
                                    </ItemsPanelTemplate>
                                </TelerikCombo:RadComboBox.ItemsPanel>
      
                            </TelerikCombo:RadComboBox>
                            <Border x:Name="Bdr_BillTo" Grid.Row="1" Grid.ColumnSpan="3" Grid.RowSpan="3" BorderThickness="1" VerticalAlignment="Top" Height="59"/>
      
                            <TextBlock x:Name="Lbl_PaymentTerms" Text="Payment Terms" Grid.Row="4" FontWeight="Normal" FontSize="10.667" VerticalAlignment="Top" Margin="5,0,0,0" Grid.ColumnSpan="2" />
                            <TelerikCombo:RadComboBox x:Name="Cmb_PaymentTerms" 
                                      Grid.Row="4" Grid.Column="2" 
                                      Height="19" MinHeight="15"  
                                      VerticalAlignment="Top"  IsEditable="True"  TabIndex="3"
                                      ItemTemplate="{StaticResource ComboBoxPaymentTermTemplate}" 
                                      IsTextSearchEnabled="True" Style="{StaticResource RadComboBoxStyle}"
                                      SelectedValuePath="PaymentTermID"
                                      telerik:TextSearch.TextPath="PaymentTermName" 
                                      ItemsSource="{Binding Payments}"
                                      ClearSelectionButtonVisibility="Visible" 
                                      ClearSelectionButtonContent="Add new payment term..."
                                      SelectedValue="{Binding CurrentInvoice.PaymentTermID,Mode=TwoWay}" SelectionChanged="Cmb_PaymentTerms_SelectionChanged">
      
                                <TelerikCombo:RadComboBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <VirtualizingStackPanel />
                                    </ItemsPanelTemplate>
                                </TelerikCombo:RadComboBox.ItemsPanel>
      
                            </TelerikCombo:RadComboBox>
                            <Border x:Name="Bdr_PaymentTerms" Grid.Row="4" Grid.ColumnSpan="3" BorderThickness="1" VerticalAlignment="Top" Height="19"/>
      
                            <TextBlock x:Name="Lbl_JobName" Text="Job" Grid.Column="5" FontWeight="Normal" FontSize="10.667" VerticalAlignment="Top" Margin="5,0,0,0"/>
                            <TelerikCombo:RadComboBox x:Name="Cmb_JobName" Grid.Column="6" 
                                      Height="19" FontSize="10.667" MinHeight="15" TabIndex="6"
                                      Margin="0,0,0,0" VerticalAlignment="Top" 
                                      ItemTemplate="{StaticResource ComboBoxJobNameTemplate}"
                                      SelectedValuePath="Jobs.JobID"
                                      IsEditable="True"  telerik:TextSearch.TextPath="JobName" 
                                      IsTextSearchEnabled="True" Style="{StaticResource RadComboBoxStyle}"
                                      ItemsSource="{Binding SelectedCustomer.Jobs}"
                                      SelectedItem="{Binding SelectedJob, Mode=TwoWay}"
                                                      ClearSelectionButtonVisibility="Collapsed"
                                      SelectedValue="{Binding CurrentInvoice.SalesDetails.JobID, Mode=TwoWay}">
      
                                <TelerikCombo:RadComboBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <VirtualizingStackPanel />
                                    </ItemsPanelTemplate>
                                </TelerikCombo:RadComboBox.ItemsPanel>
      
                            </TelerikCombo:RadComboBox>
                            <Border x:Name="Bdr_JobName" Grid.Column="5" Grid.ColumnSpan="2" BorderThickness="1" VerticalAlignment="Top" Height="19"/>
      
                            <TextBlock x:Name="Lbl_ShipTo" Text="Ship To" Grid.Row="1" Grid.Column="5" Grid.RowSpan="3" FontWeight="Normal" FontSize="10.667" VerticalAlignment="Top" Margin="5,0,0,0" Height="59"/>
                            <TelerikCombo:RadComboBox x:Name="Cmb_ShipTo" 
                                      Grid.Row="1" Grid.Column="6" Grid.RowSpan="3" 
                                      Height="59" VerticalAlignment="Top" 
                                      SelectedValuePath="AddressID"
                                      ItemTemplate="{StaticResource ComboBoxAddressTemplate}" 
                                      SelectionBoxTemplate="{StaticResource ComboBoxSelectedAddressTemplate}" 
                                      telerik:TextSearch.TextPath="Address1" FontSize="10.667" Padding="4" 
                                      TabIndex="7"
                                      ItemsSource="{Binding SelectedCustomer.Addresses, Mode=TwoWay}"
                                      SelectedValue="{Binding CurrentInvoice.ShipToAddressID, Mode=TwoWay}">
      
                                <TelerikCombo:RadComboBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <VirtualizingStackPanel />
                                    </ItemsPanelTemplate>
                                </TelerikCombo:RadComboBox.ItemsPanel>
      
                            </TelerikCombo:RadComboBox>
                            <Border x:Name="Bdr_ShipTo" Grid.Row="1" Grid.Column="5" Grid.ColumnSpan="2" Grid.RowSpan="3" BorderThickness="1" VerticalAlignment="Top" Height="59"/>
      
                            <TextBlock x:Name="Lbl_DueDate" Text="Due Date" Grid.Row="4" Grid.Column="3" FontWeight="Normal" FontSize="10.667" VerticalAlignment="Top" Margin="5,0,0,0"/>
                            <StackPanel x:Name="Stk_DueDate" Orientation="Horizontal" Grid.Row="4" Grid.Column="4" VerticalAlignment="Top">
                                    <telerikInput:RadDatePicker  x:Name="Dt_DueDate"  FontSize="9.5" TabNavigation="Once" MinHeight="15" Height="19" VerticalAlignment="Top" Width="83" HorizontalAlignment="Left" TabIndex="4"
                                                                 SelectedValue="{Binding Path=CurrentInvoice.DueDate, Mode=TwoWay}" />
                                    <TextBlock x:Name="Lbl_DeliDate" Text="Delivery Date" FontWeight="Normal" FontSize="10.667" VerticalAlignment="Top" Margin="30,0,20,0" HorizontalAlignment="Center"/>
                                    <telerikInput:RadDatePicker  x:Name="Dt_DeliDate"  Width="83" Height="19" FontSize="9.5" TabNavigation="Once" MinHeight="15" VerticalAlignment="Top" HorizontalAlignment="Right" TabIndex="5"
                                                                 SelectedValue="{Binding Path=SelectedDeliveryDate, Mode=TwoWay}" />
                                </StackPanel>
                            <Border x:Name="Bdr_DueDate" Grid.Row="4" Grid.Column="3" Grid.ColumnSpan="2" BorderThickness="1" VerticalAlignment="Top" Height="19"/>
      
                            <TextBlock x:Name="Lbl_ShippingMethod" Text="Shipping Method" Grid.Row="4" Grid.Column="5" FontWeight="Normal" FontSize="10.667" VerticalAlignment="Top" Margin="5,0,0,0"/>
                            <telerikInput:RadComboBox x:Name="Cmb_ShippingMethod" 
                                      Grid.Row="4" Grid.Column="6"  
                                      Height="19" VerticalAlignment="Top" 
                                      ItemTemplate="{StaticResource ComboBoxShippingMethodTemplate}" 
                                      IsEditable="True" IsTextSearchEnabled="True" 
                                      SelectedValuePath="ShippingMethodID" Style="{StaticResource RadComboBoxStyle}"
                                      telerik:TextSearch.TextPath="ShippingMethodName"  
                                      FontSize="10.667" MinHeight="15" TabIndex="8"
                                                      ItemsSource="{Binding ShippingMethods}"
                                                      ClearSelectionButtonVisibility="Visible" ClearSelectionButtonContent="Add new shipping method..."
                                      SelectedValue="{Binding CurrentInvoice.ShippingMethodID, Mode=TwoWay}">
      
                                <TelerikCombo:RadComboBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <VirtualizingStackPanel />
                                    </ItemsPanelTemplate>
                                </TelerikCombo:RadComboBox.ItemsPanel>
      
                            </telerikInput:RadComboBox>
                            <Border x:Name="Bdr_ShippingMethod" Grid.Row="4" Grid.Column="5" Grid.ColumnSpan="2" BorderThickness="1" VerticalAlignment="Top" Height="19"/>
      
                            <TextBlock x:Name="Lbl_ProductAndService" Text="Product and Service" Grid.Row="5" Grid.ColumnSpan="7" Height="19" VerticalAlignment="Top" FontWeight="Bold"/>
                            <Border x:Name="Bdr_ProductAndService" Grid.Row="5" Grid.ColumnSpan="7" BorderThickness="1" Visibility="Visible" Height="Auto" VerticalAlignment="Top">
                                <telerik:RadBusyIndicator x:Name="BusyIndicator" BusyContent="Loading data..." DisplayAfter="0" AllowDrop="True" IsIndeterminate="True" Background="Transparent" BorderBrush="Transparent" BorderThickness="0">
                                    <TelerikGrid:RadGridView x:Name="dtgProductAndService" AlternationCount="2"
                                                            ShowGroupPanel="False" AutoGenerateColumns="False" 
                                                            Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="6"
                                                            Height="252" TabIndex="9" RowHeight="19" Margin="0,15,0,0" 
                                                            IsFilteringAllowed="False" CanUserSortColumns="False"
                                                            CanUserFreezeColumns="False" ItemsSource="{Binding Path=ItemCollection, Mode=TwoWay}" >
      
                                        <TelerikGrid:RadGridView.Background>
                                        <ImageBrush ImageSource="{Binding Source={StaticResource iconviewmodel}, Path=GridLines}" Stretch="None"  AlignmentX="Left" AlignmentY="Top"/>
                                    </TelerikGrid:RadGridView.Background>
                                        <TelerikGrid:RadGridView.Columns >
      
                                        <TelerikGrid:GridViewComboBoxColumn x:Name="CmbItm" Width="3*" IsComboBoxEditable="True"
                                                                        DataMemberBinding="{Binding ItemID}" UniqueName="Item"
                                                                        DisplayMemberPath="ItemName" Header="Item"
                                                                        SelectedValueMemberPath="ItemID" 
                                                                    DisplayIndex="0" ItemsSource="{Binding Path=Items, Source={StaticResource invoiceViewModel}}">
      
      
      
                                            <TelerikGrid:GridViewComboBoxColumn.CellStyle>
                                                <Style TargetType="TelerikGrid:GridViewCell">
                                                    <Setter Property="Height" Value="19"/>
                                                </Style>
                                            </TelerikGrid:GridViewComboBoxColumn.CellStyle>
      
                                            <TelerikGrid:GridViewComboBoxColumn.EditorStyle >
                                                <Style TargetType="TelerikCombo:RadComboBox" >
                                                    <Setter Property="MinHeight" Value="15"/>
                                                    <Setter Property="Height" Value="19"/>
                                                    <Setter Property="Margin" Value="0"/>
                                                    <Setter Property="ItemContainerStyle">
                                                        <Setter.Value>
                                                            <Style TargetType="TelerikCombo:RadComboBoxItem">
                                                                <Setter Property="Template">
                                                                    <Setter.Value>
                                                                        <ControlTemplate>
                                                                            <Grid>
                                                                                <Grid.RowDefinitions >
                                                                                    <RowDefinition/>
                                                                                </Grid.RowDefinitions>
                                                                                <Grid.ColumnDefinitions>
                                                                                    <ColumnDefinition />
                                                                                    <ColumnDefinition />
                                                                                    <ColumnDefinition />
                                                                                </Grid.ColumnDefinitions>
                                                                                <TextBlock Text="{Binding ItemName}" Grid.Row="0" Grid.Column="0" Width="256" />
                                                                                <TextBlock Text="{Binding SalesDescription}" Grid.Row="0" Grid.Column="1" Width="256"/>
                                                                                <TextBlock Text="{Binding ItemID}" Grid.Row="0" Grid.Column="2" Width="0" />
                                                                            </Grid>
                                                                        </ControlTemplate>
                                                                    </Setter.Value>
                                                                </Setter>
                                                            </Style>
                                                        </Setter.Value>
                                                    </Setter>
                                                </Style>
                                            </TelerikGrid:GridViewComboBoxColumn.EditorStyle>
      
                                        </TelerikGrid:GridViewComboBoxColumn>
      
                                        <TelerikGrid:GridViewDataColumn Header="Description" Width="3*" DataMemberBinding="{Binding LineDescription, Mode=TwoWay}" DisplayIndex="1"/>
                                        <!--<TelerikGrid:GridViewMaskedTextBoxColumn Header="Description" Width="3*" DataMemberBinding="{Binding LineDescription, Mode=TwoWay}" DisplayIndex="1" MaskType="None"/>-->
                                        <TelerikGrid:GridViewDataColumn UniqueName="UOM" DataMemberBinding="{Binding UOM, Mode=TwoWay}"  TextAlignment="Left"  Header="UOM" Width="1*" IsReadOnly="True" DisplayIndex="2"/>
                                        <TelerikGrid:GridViewDataColumn UniqueName="Quantity" Header="Quantity" Width="1*" TextAlignment="Right" DataMemberBinding="{Binding Quantity, Mode=TwoWay}" DataFormatString = "{}{0:N2}" DisplayIndex="3"/>
                                              
                                        <!--<TelerikGrid:GridViewDataColumn UniqueName="UnitPrice" Header="Price" Width="1*" TextAlignment="Right" DataMemberBinding="{Binding UnitPrice, Mode=TwoWay}" DataFormatString = "{}{0:c2}" DisplayIndex="4"/>-->
                                              
                                        <TelerikGrid:GridViewMaskedTextBoxColumn MaskType="Numeric" Mask="c" UniqueName="UnitPrice" Header="Price" Width="1*" TextAlignment="Right" DataMemberBinding="{Binding UnitPrice, Mode=TwoWay}" DataFormatString = "{}{0:c2}" DisplayIndex="4" />
                                              
                                        <TelerikGrid:GridViewDataColumn UniqueName="LineTotal" DataMemberBinding="{Binding LineTotal, Mode=TwoWay}" DataFormatString = "{}{0:c2}" TextAlignment="Right" Header="Amount" Width="2*" IsReadOnly="True" DisplayIndex="5"/>
      
                                        <TelerikGrid:GridViewComboBoxColumn Width="2*" IsComboBoxEditable="True" DisplayMemberPath="ItemTaxName" Header="Tax" 
                                                                            DataMemberBinding="{Binding ItemTaxID}" SelectedValueMemberPath="ItemTaxID"  UniqueName="ItemTax"
                                                                            ItemsSource="{Binding ItemTaxes, Source={StaticResource invoiceViewModel}}" DisplayIndex="6">
                                            <TelerikGrid:GridViewComboBoxColumn.CellStyle>
                                                <Style TargetType="TelerikGrid:GridViewCell">
                                                    <Setter Property="Height" Value="19"/>
                                                </Style>
                                            </TelerikGrid:GridViewComboBoxColumn.CellStyle>
                                            <TelerikGrid:GridViewComboBoxColumn.EditorStyle >
                                                <Style TargetType="TelerikCombo:RadComboBox">
                                                    <Setter Property="MinHeight" Value="15"/>
                                                    <Setter Property="Height" Value="19"/>
                                                    <Setter Property="Margin" Value="0"/>
                                                    <Setter Property="ItemContainerStyle" >
                                                        <Setter.Value >
                                                            <Style TargetType="TelerikCombo:RadComboBoxItem" >
                                                                <Setter Property="Template">
                                                                    <Setter.Value>
                                                                        <ControlTemplate>
                                                                            <Grid>
                                                                                <Grid.RowDefinitions >
                                                                                    <RowDefinition/>
                                                                                </Grid.RowDefinitions>
                                                                                <Grid.ColumnDefinitions>
                                                                                    <ColumnDefinition />
                                                                                    <ColumnDefinition />
                                                                                </Grid.ColumnDefinitions>
                                                                                <TextBlock Text="{Binding ItemTaxName}" Grid.Row="0" Grid.Column="0" Width="Auto"/>
                                                                                <TextBlock Text="{Binding ItemTaxID}" Grid.Row="0" Grid.Column="1" Width="0"/>
                                                                            </Grid>
                                                                        </ControlTemplate>
                                                                    </Setter.Value>
                                                                </Setter>
                                                            </Style>
                                                        </Setter.Value>
                                                    </Setter>
                                                </Style>
                                            </TelerikGrid:GridViewComboBoxColumn.EditorStyle>
                                        </TelerikGrid:GridViewComboBoxColumn>
      
                                    </TelerikGrid:RadGridView.Columns>
                                    </TelerikGrid:RadGridView>
                                </telerik:RadBusyIndicator>
                            </Border>
      
      
                            <TextBlock x:Name="Lbl_Reference" Text="Reference" Grid.Row="6" FontWeight="Normal" FontSize="10.667" VerticalAlignment="Top" Margin="5,0,0,0" Grid.ColumnSpan="2" />
                            <telerikInput:RadMaskedTextBox x:Name="Txt_Reference" MinHeight="15" Height="19" Grid.Row="6" Grid.Column="2" FontSize="10" FontFamily="Verdana" VerticalAlignment="Top" MaskType="None" TabIndex="10"
                                                           Value="{Binding Path=CurrentInvoice.Reference, Mode=TwoWay}"/>
                            <Border x:Name="Bdr_Reference" Grid.Row="6" Grid.ColumnSpan="3" BorderThickness="1" VerticalAlignment="Top" Height="19" />
      
                            <TextBlock x:Name="Lbl_Memo" Text="Customer Memo" FontWeight="Normal" Grid.Row="7" Grid.RowSpan="3" VerticalAlignment="Top"  FontSize="10.667" Height="59" Margin="5,0,0,0" Grid.ColumnSpan="2" />
                            <telerikInput:RadMaskedTextBox x:Name="Txt_Memo" Grid.Row="7" Grid.RowSpan="3" Grid.Column="2" Height="59" Margin="0,0,0,0" VerticalAlignment="Top" MaskType="None" TabIndex="11"
                                                           Value="{Binding Path=CurrentInvoice.Remarks, Mode=TwoWay}"/>
                            <Border x:Name="Bdr_Memo" Grid.Row="7" Grid.RowSpan="3" Grid.ColumnSpan="3" BorderThickness="1" VerticalAlignment="Top" Height="59"/>
      
                            <TextBlock x:Name="Lbl_TaxGroup" Text="Tax Group" Grid.Row="6" Grid.Column="3" FontWeight="Normal" FontSize="10.667" VerticalAlignment="Top" Margin="5,0,0,0"/>
                            <telerikInput:RadComboBox x:Name="Cmb_TaxGroup" 
                                      Grid.Row="6" Grid.Column="4"  
                                      Height="19" MinHeight="15" TabIndex="12" 
                                      IsEditable="True"  VerticalAlignment="Top"
                                      SelectedValuePath="SalesTaxGroupID" Style="{StaticResource RadComboBoxStyle}"
                                      DisplayMemberPath="SalesTaxGroupName" 
                                      ItemsSource="{Binding TaxGroups}"
                                      ClearSelectionButtonVisibility="Visible" ClearSelectionButtonContent="Add new tax group..."
                                      SelectedValue="{Binding CurrentInvoice.SalesTaxGroupID, Mode=TwoWay}">
      
                                <TelerikCombo:RadComboBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <VirtualizingStackPanel />
                                    </ItemsPanelTemplate>
                                </TelerikCombo:RadComboBox.ItemsPanel>
      
                            </telerikInput:RadComboBox>
                            <Border x:Name="Bdr_TaxGroup" Grid.Row="6" Grid.Column="3" Grid.ColumnSpan="2" BorderThickness="1" VerticalAlignment="Top" Height="19"/>
      
                            <TextBlock x:Name="Lbl_Class" Text="Class" Grid.Row="7" Grid.Column="3" FontWeight="Normal" FontSize="10.667" VerticalAlignment="Top" Margin="5,0,0,0"/>
                            <telerikInput:RadComboBox x:Name="Cmb_Class" 
                                      Grid.Row="7" Grid.Column="4" Height="19" 
                                      ItemTemplate="{StaticResource ComboBoxClassTemplate}" 
                                      IsEditable="True"  telerik:TextSearch.TextPath="ClassName" 
                                      IsTextSearchEnabled="True" FontSize="10.667" VerticalAlignment="Top"
                                      SelectedValuePath="ClassID" Style="{StaticResource RadComboBoxStyle}"
                                      ItemsSource="{Binding Classes}" ClearSelectionButtonVisibility="Collapsed"
                                      TabNavigation="Local" MinHeight="15" TabIndex="13"
                                                      SelectedItem="{Binding SelectedClass, Mode=TwoWay}"
                                      SelectedValue="{Binding CurrentInvoice.ClassID, Mode=TwoWay}">
      
                                <TelerikCombo:RadComboBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <VirtualizingStackPanel />
                                    </ItemsPanelTemplate>
                                </TelerikCombo:RadComboBox.ItemsPanel>
      
                            </telerikInput:RadComboBox>
                            <Border x:Name="Bdr_Class" Grid.Row="7" Grid.Column="3" Grid.ColumnSpan="2" BorderThickness="1" VerticalAlignment="Top" Height="19"/>
      
                            <TextBlock x:Name="Lbl_ExchangeRate" Text="Exchange Rate" Grid.Row="8" Grid.Column="3" FontWeight="Normal" FontSize="10.667" VerticalAlignment="Top" Margin="5,0,0,0"/>
                            <StackPanel x:Name="Stk_ExchangeRate" Orientation="Horizontal" Grid.Row="8" Grid.Column="4" VerticalAlignment="Top" >
                                <TextBlock  Text="1 USD =" FontWeight="Normal" Margin="0,0,0,0" VerticalAlignment="Bottom"  FontSize="10.667" />
                                <TextBox x:Name="Txt_Usd"  Margin="5,0,0,0"  Text="1" TextWrapping="NoWrap" Height="19" Width="65" FontSize="10.667"  FontFamily="Verdana" VerticalAlignment="Center" IsReadOnly="True" TabIndex="0"/>
                                <TextBlock  Text="USD" FontWeight="Normal" Margin="3,0,0,0" VerticalAlignment="Bottom"  FontSize="10.667"/>
                            </StackPanel>
                            <Border x:Name="Bdr_ExchangeRate" Grid.Row="8" Grid.Column="3" Grid.ColumnSpan="2" BorderThickness="1" VerticalAlignment="Top" Height="19"/>
      
                            <TextBlock x:Name="Lbl_SalesTax" Text="Tax" Grid.Row="6" Grid.Column="5" FontWeight="Normal" FontSize="10.667" VerticalAlignment="Top" Margin="5,0,0,0"/>
                            <telerikInput:RadMaskedTextBox x:Name="Txt_SalesTax" Grid.Row="6" Grid.Column="6" MinHeight="15" Height="19" Margin="0,0,0,0" VerticalAlignment="Top" IsReadOnly="True" MaskType="Numeric" Mask="c" FlowDirection="RightToLeft"  TabIndex="0"
                                                           Value="{Binding Path=CurrentInvoice.SalesTaxAmount, Mode=TwoWay}"/>
                            <Border x:Name="Bdr_SalesTax" Grid.Row="6" Grid.Column="5" Grid.ColumnSpan="2" BorderThickness="1" VerticalAlignment="Top" Height="19"/>
      
                            <TextBlock x:Name="Lbl_Total" Text="Total" Grid.Row="7" Grid.Column="5" FontWeight="Normal" FontSize="10.667" VerticalAlignment="Top" Margin="5,0,0,0"/>
                            <telerikInput:RadMaskedTextBox x:Name="Txt_Total" Grid.Row="7" Grid.Column="6" MinHeight="15" Height="19" Margin="0,0,0,0" VerticalAlignment="Top" IsReadOnly="True" MaskType="Numeric" Mask="c" FlowDirection="RightToLeft" TabIndex="0"
                                                           Value="{Binding Path=CurrentInvoice.TotalAmount, Mode=TwoWay}"/>
                            <Border x:Name="Bdr_Total" Grid.Row="7" Grid.Column="5" Grid.ColumnSpan="2" BorderThickness="1" Height="19" Margin="0,0,0,1" />
      
                            <TextBlock x:Name="Lbl_TotalUsd" Text="Total (USD)" Grid.Row="8" Grid.Column="5" FontWeight="Normal" FontSize="10.667" VerticalAlignment="Top" Margin="5,0,0,0"/>
                            <telerikInput:RadMaskedTextBox x:Name="Txt_TotalUsd" Grid.Row="8" Grid.Column="6" MinHeight="15" Height="19" Margin="0,0,0,1" IsReadOnly="True" MaskType="Numeric" Mask="c" FlowDirection="RightToLeft" TabIndex="0"
                                                           Value="{Binding Path=CurrentInvoice.TotalAmountCurrency, Mode=TwoWay}"/>
                            <Border x:Name="Bdr_TotalUsd" Grid.Row="8" Grid.Column="5" Grid.ColumnSpan="2" BorderThickness="1" VerticalAlignment="Top" Height="19"/>
      
                            <TextBlock x:Name="Lbl_BalanceDue" Text="Balance Due" FontWeight="Normal" Grid.Row="9" Grid.Column="5" VerticalAlignment="Top"  FontSize="10.667" Margin="5,0,0,0"/>
                            <telerikInput:RadMaskedTextBox x:Name="Txt_BalanceDue" Grid.Row="9" Grid.Column="6" MinHeight="15" Height="19" Margin="0,0,0,0" VerticalAlignment="Top" IsReadOnly="True" MaskType="Numeric" Mask="c" FlowDirection="RightToLeft" TabIndex="0"
                                                           Value="{Binding Path=CurrentInvoice.Balance, Mode=TwoWay}"/>
                            <Border x:Name="Bdr_BalanceDue" Grid.Row="9" Grid.Column="5" Grid.ColumnSpan="2" BorderThickness="1" VerticalAlignment="Top" Height="19"/>
      
                            <TextBlock x:Name="Lbl_Payment" Text="Payment" Grid.Row="10" Grid.Column="5" FontWeight="Normal" FontSize="10.667" VerticalAlignment="Top" Margin="5,0,0,0"/>
                            <telerikInput:RadMaskedTextBox x:Name="Txt_Payment" Grid.Row="10" Grid.Column="6" MinHeight="15" Height="19" Margin="0,0,0,0" VerticalAlignment="Top" IsReadOnly="True" MaskType="Numeric" Mask="c" FlowDirection="RightToLeft" TabIndex="0"
                                                           Value="{Binding Path=CurrentInvoice.PaidAmount, Mode=TwoWay}"/>
                            <Border x:Name="Bdr_Payment" Grid.Row="10" Grid.Column="5" Grid.ColumnSpan="2" BorderThickness="1" VerticalAlignment="Top" Height="19"/>
      
                        </Grid>
                    </ScrollViewer>
                </TelerikDocking:RadDocking.DocumentHost>
      
                <TelerikDocking:RadSplitContainer InitialPosition="DockedRight" Width="175" Visibility="Visible">
                    <TelerikDocking:RadPaneGroup >
                        <TelerikDocking:RadPane x:Name="RadPan" Header="Screen Designer" IsHidden="false" CanFloat="False" CanUserClose="False" CanUserPin="False" PaneHeaderVisibility="visible"  >
                            <Grid>                  
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="80"/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>
      
                                <StackPanel Grid.Row="0" Orientation="Vertical" HorizontalAlignment="Center" Height="80" VerticalAlignment="Top">
                                    <StackPanel HorizontalAlignment="Center">
                                        <telerikRibbonBar:RadRibbonButton Width="20" Height="20" x:Name="Btn_Up" Command="{Binding MoveUpCommand}" >
                                            <Image Source="{Binding Source={StaticResource iconviewmodel}, Path=Up}" Width="16" Height="16" />
                                            <!--<Image Source="./Images/up.png" Height="16" Width="16"/>-->
                                        </telerikRibbonBar:RadRibbonButton>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                        <telerikRibbonBar:RadRibbonButton Width="20" Height="20" x:Name="Btn_Left" Margin="0,0,10,0" Command="{Binding MoveLeftCommand}" >
                                            <Image Source="{Binding Source={StaticResource iconviewmodel}, Path=Left}" Width="16" Height="16" />
                                            <!--<Image Source="./Images/resultset_Left.png" Height="16" Width="16"/>-->
                                        </telerikRibbonBar:RadRibbonButton>
                                        <telerikRibbonBar:RadRibbonButton Width="20" Height="20" x:Name="Btn_Right" Margin="10,0,0,0" Command="{Binding MoveRightCommand}">
                                            <Image Source="{Binding Source={StaticResource iconviewmodel}, Path=Right}" Width="16" Height="16" />
                                            <!--<Image Source="./Images/Right.png" Height="16" Width="16"/>-->
                                        </telerikRibbonBar:RadRibbonButton>
                                    </StackPanel>
                                    <StackPanel HorizontalAlignment="Center">
                                        <telerikRibbonBar:RadRibbonButton Width="20" Height="20" x:Name="Btn_Down" Command="{Binding MoveDownCommand}">
                                            <Image Source="{Binding Source={StaticResource iconviewmodel}, Path=Down}" Width="16" Height="16"  />
                                            <!--<Image Source="./Images/down.png" Height="16" Width="16"/>-->
                                        </telerikRibbonBar:RadRibbonButton>
                                    </StackPanel>
                                    <StackPanel Height="20" HorizontalAlignment="Center">
                                        <TextBlock Text="Positions"/>
                                    </StackPanel>
                                </StackPanel>
      
                                <StackPanel Grid.Row="1" Orientation="Vertical" VerticalAlignment="Top" >
                                    <telerikNavigation:RadPanelBar x:Name="PanelBar_HideShowFields" ExpandMode="Single" ScrollViewer.VerticalScrollBarVisibility="Auto" Height="400">
      
                                        <telerikNavigation:RadPanelBarItem x:Name="PanelBarItem" IsExpanded="True">
                                            <telerikNavigation:RadPanelBarItem.Header>
                                                <TextBlock Text="Hide / Show Field" Foreground="#FF154A93" />
                                            </telerikNavigation:RadPanelBarItem.Header>
                                        </telerikNavigation:RadPanelBarItem>
      
                                        <telerikNavigation:RadPanelBarItem x:Name="PersistentItems" IsExpanded="True">
                                            <telerikNavigation:RadPanelBarItem.Header>
                                                <TextBlock Text="Hide / Show Columns" Foreground="#FF154A93" />
                                            </telerikNavigation:RadPanelBarItem.Header>
                                        </telerikNavigation:RadPanelBarItem>
                                    </telerikNavigation:RadPanelBar>                                
                                </StackPanel>
                            </Grid>
                        </TelerikDocking:RadPane>
                    </TelerikDocking:RadPaneGroup>
                </TelerikDocking:RadSplitContainer>            
            </TelerikDocking:RadDocking>
        </Grid>
    </UserControl>

                    .


  4. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 02 Aug 2011 Link to this post

    Hi Parameswari,

    I doubt that you can serialize an entire Silverlight page as a string and then deserialize it from this string, but I might be wrong. I am not aware of such a technique, but you might get more information on the Silverlight forums, since this is a general Silverlight topic and is not related to Telerik controls in particular. 

    As for Telerik controls, you can try to use our new Persistence Framework.

    That's about everything I can think of. I hope this helps.

    Kind regards,
    Ross
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  5. Parameswari
    Parameswari avatar
    19 posts
    Member since:
    Jun 2011

    Posted 03 Aug 2011 Link to this post


    Hi Ross,
      Can you please tell  us is there  any other way to serialize the controls in the form ,their position ,size ... 
    But this should be done for all the controls in the form at a moment
    Pls guide us in this issue .We are not able to procede without this .
    If can Provide us with the sample
    Thanks,
    Parameswari 
  6. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 03 Aug 2011 Link to this post

    Hello Parameswari,

    I have already explained that the question you are asking is a general Silverlight question and is not related to Telerik controls in any way. 

    Please, tell me this. Imagine that you have not bought Telerik control and you don't have them. You have a Silverlight page that has only standard controls such as Button, ListBox, etc. 

    How would you serialize your page? Is this question related to Telerik in any way.

    Once you have the answer to this question, which is not related to Telerik in anyway, my answer is that you can serialize our controls in absolutely the same way as you would serialize the standard controls.

    It does not matter whether you have a Button or a RadGridView -- both of them are Silverlight Controls.


    Does this makes any sense?

    To the best of my knowledge, Silverlight does not offer this feature, but I might be wrong.

    I hope this helps.

    All the best,
    Ross
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  7. Parameswari
    Parameswari avatar
    19 posts
    Member since:
    Jun 2011

    Posted 03 Aug 2011 Link to this post

    Hi Ross,
     Thanks for your suggestion.
    Rds,
    Parameswari
Back to Top