DataTemplate:
Expand|Select|Wrap|Line Numbers
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- x:Class="AgamistaStore.Resources.DataTemplatesClass"
- xmlns:myClasses="clr-namespace:AgamistaStore.Classes"
- >
- <myClasses:TablesStateConverter x:Key="TablesStateConverter"/>
- <myClasses:OrderItemNotEditableStateConverter x:Key="NotEditableStateConverter"/>
- <!-- ProductName column -->
- <DataTemplate x:Key="NotEditableStateColumnTemplate">
- <Image Height="20" Width="20" Source="{Binding Path=NotEditable,
- Converter={StaticResource NotEditableStateConverter}, Mode=Default}" HorizontalAlignment="Stretch"/>
- </DataTemplate>
- <!-- Barcode column -->
- <DataTemplate x:Key="ProductBarcodeColumnTemplate">
- <TextBlock FontFamily="Tahoma" FontSize="14" Text="{Binding Path=ProductBarcode}" HorizontalAlignment="Stretch"
- Foreground="#FF44544A" />
- </DataTemplate>
- <!-- ProductName column -->
- <DataTemplate x:Key="ProdNameColumnTemplate">
- <TextBlock FontFamily="Tahoma" FontSize="14" Text="{Binding Path=ProductName}" HorizontalAlignment="Stretch"
- Foreground="#FF44544A"/>
- </DataTemplate>
- <!-- Price column -->
- <DataTemplate x:Key="PriceNameColumnTemplate">
- <TextBlock x:Name="SalePrice" FontFamily="Tahoma" FontSize="14" HorizontalAlignment="Stretch"
- Text="{Binding Path=SalePrice, StringFormat={}{0:#.##}}" Foreground="#FF44544A"/>
- </DataTemplate>
- <!-- Quntity column -->
- <DataTemplate x:Key="QuntityColumnTemplate">
- <TextBox x:Name="txtQuntity" Tag="{Binding}" PreviewTextInput="txtQuntity_PreviewTextInput"
- Style="{StaticResource TextBoxStyle}" Height="20" Foreground="#FF0A421F"
- FontFamily="Tahoma" FontSize="14" Text="{Binding Path=SoldQuantity}" HorizontalAlignment="Stretch"/>
- </DataTemplate>
- </ResourceDictionary>
Expand|Select|Wrap|Line Numbers
- <Border Grid.Column="1" CornerRadius="6,6,6,6" BorderThickness="1,1,1,1" BorderBrush="#FFBCC7BB"
- Margin="9,10,8,10" x:Name="borderDetails">
- <Grid HorizontalAlignment="Left" Width="439" Margin="0,0,0,0" VerticalAlignment="Top"
- Height="397" Visibility="Visible">
- <Grid.RowDefinitions>
- <RowDefinition Height="352*" />
- <RowDefinition Height="45*" />
- </Grid.RowDefinitions>
- <!--bill details -->
- <myClasses:SortableListView Margin="9,6,6,0" Height="auto" BorderBrush="{x:Null}"
- Background="{x:Null}" ScrollViewer.VerticalScrollBarVisibility="Auto"
- ScrollViewer.HorizontalScrollBarVisibility="Auto" AllowDrop="True"
- VirtualizingStackPanel.IsVirtualizing="True" ScrollViewer.CanContentScroll="True"
- SelectionMode="Single" IsSynchronizedWithCurrentItem="True"
- ItemContainerStyle="{DynamicResource RestaurantEditListViewItemStyle}"
- Style="{DynamicResource RestaurantEditListViewStyle}" IsEnabled="True"
- HorizontalAlignment="Stretch" VerticalAlignment="Top" x:Name="gvOrderDetails" >
- <myClasses:SortableListView.View>
- <GridView AllowsColumnReorder="False" >
- <GridViewColumn Width="4"
- HeaderContainerStyle="{DynamicResource FirstColumnGridViewColumnHeader}"
- CellTemplate="{StaticResource EmptyColumnTemplate}"/>
- <GridViewColumn Width="8" CellTemplate="{StaticResource NotEditableStateColumnTemplate}"
- HeaderContainerStyle="{DynamicResource RestaurantDataGridViewColumnHeader}"/>
- <myClasses:SortListViewColumn Header="??? ?????" SortProperty="ProductBarcode"
- Width="80" CellTemplate="{StaticResource ProductBarcodeColumnTemplate}"
- SortStyle="RestaurantDataGridViewColumnHeader"
- HeaderContainerStyle="{DynamicResource RestaurantDataGridViewColumnHeader}" />
- <myClasses:SortListViewColumn Header="???? ????????" SortProperty="ProductName"
- Width="200" CellTemplate="{StaticResource ProdNameColumnTemplate}"
- SortStyle="RestaurantDataGridViewColumnHeader"
- HeaderContainerStyle="{DynamicResource RestaurantDataGridViewColumnHeader}" />
- <myClasses:SortListViewColumn Header="?????" SortProperty="SalePrice"
- CellTemplate="{StaticResource PriceNameColumnTemplate}"
- Width="60" SortStyle="RestaurantDataGridViewColumnHeader"
- HeaderContainerStyle="{DynamicResource RestaurantDataGridViewColumnHeader}" />
- <myClasses:SortListViewColumn Header="??????" SortProperty="UnitName" Width="50"
- CellTemplate="{StaticResource QuntityColumnTemplate}"
- SortStyle="RestaurantDataGridViewColumnHeader"
- HeaderContainerStyle="{DynamicResource RestaurantDataGridViewColumnHeader}"/>
- <GridViewColumn Width="4" CellTemplate="{StaticResource EmptyColumnTemplate}"
- HeaderContainerStyle="{DynamicResource LastColumnGridViewColumnHeader}"/>
- </GridView>
- </myClasses:SortableListView.View>
- </myClasses:SortableListView>
for example:
Barcode ProductName Price Quantity
S1P3C34 T-shirt 150 1
The Total Amount which will appear in textbox must be (150*1) 150
If the user change the value of quantity to 3 , I want Total Amount value changed automatically to be (150*3) 450
What is the best practice to do this ?
Thanks,