Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

how to calculate qty * rate =amount... datagridtextcolum in datagrid in wpf using entityframework

$
0
0

 <DataGrid AutoGenerateColumns="False" 
                  Grid.Row="2"  
                  HorizontalAlignment="Stretch" 
                  Margin="0,2,0,0" 
                  Name="CenterGrid"
                  IsSynchronizedWithCurrentItem="True"
                  VerticalAlignment="Top"
                  CanUserAddRows="True"
                  CanUserDeleteRows="True" 

                  ItemsSource="{Binding Source={StaticResource DetailsViewSource}}"  >

            <DataGrid.Columns>

                <DataGridComboBoxColumn x:Name="cmbCentername" Header="Item Name"
                                           ItemsSource="{Binding Source={StaticResource ItemList}}"
                                            SelectedItemBinding="{Binding Path=ItemMaster}"
                                            DisplayMemberPath="ItemName"
                                            SelectedValuePath="ItemId">
                    <DataGridComboBoxColumn.EditingElementStyle>
                        <Style TargetType="ComboBox">
                            <Setter Property="IsEditable" Value="True" />
                            <Setter Property="IsDropDownOpen" Value="True"/>
                        </Style>
                    </DataGridComboBoxColumn.EditingElementStyle>
                </DataGridComboBoxColumn>


                <DataGridTextColumn  x:Name="txtqty" Header="Qty" Width="*" Binding="{Binding Path=Qty}"/>
                <DataGridTextColumn  x:Name="txtrate" Header="Rate" Width="*" Binding="{Binding Path=Rate}"/>

                <DataGridTextColumn  x:Name="txtamount" Header="Amount" Width="*" SortMemberPath="Amount"  >

                    <DataGridTextColumn.Binding>
                        <MultiBinding Mode="OneWay"  Converter="{StaticResource AmountConverters}">
                                <Binding Path="Qty"/>
                            <Binding Path="Rate"/>
                            </MultiBinding>
                    </DataGridTextColumn.Binding>

                </DataGridTextColumn>

            </DataGrid.Columns>
        </DataGrid> 

Detailviewsource is Collectionviewsource ..


i am doing this project using Entity Framework and wpf

i want want to multiply qty* rate = amount runtime with binding and i want to bind Amount Property of Detailviewsource because it can be send automatically send in to database.. how to do it Using Multibinding and Without Multibinding Or any other Procedure..

in this image amount is manully type

                                                                                            

Dipak Sutare




Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>