Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8450637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:01:22+00:00 2026-06-10T11:01:22+00:00

I’m using Galasoft’s EventToCommand as code below to update Line Total cell after user

  • 0

I’m using Galasoft’s EventToCommand as code below to update Line Total cell after user inserts price and quantity.
Please, help me find the appropriate way to make the Line Total changes when I insert the price, quantity and hit Enter. I tried InputBindings, but unfortunately didn’t work.

Here is the Datagrid XAML from my View:

<DataGrid  IsReadOnly="False" x:Name="_StockCardItems"  ItemsSource="{Binding InvoiceDetailsList, Mode=TwoWay}" SelectedItem="{Binding SelectedItem}"  CanUserDeleteRows="True" CanUserAddRows="False">
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="CurrentCellChanged">
            <gs:EventToCommand PassEventArgsToCommand="True" Command="{Binding CurrentCellChangedCommand}"/>
        </i:EventTrigger>
    </i:Interaction.Triggers>

    <DataGrid.InputBindings>
        <KeyBinding Key="Enter" Command="{Binding CurrentCellChangedCommand}"/>
    </DataGrid.InputBindings>

    <DataGrid.Columns>

        <DataGridTemplateColumn Header="Désignation" Width="400" IsReadOnly="True">
            <DataGridTemplateColumn.CellTemplate  >
                <DataTemplate>
                    <TextBlock Margin="10,2" HorizontalAlignment="Left" Text="{Binding Path=Items.Designation}" />
                </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>

        <DataGridTemplateColumn Header="Quantité"  Width="150" IsReadOnly="False">
            <DataGridTemplateColumn.CellTemplate  >
                <DataTemplate>
                    <TextBox  Margin="10,0" HorizontalAlignment="Center" GotKeyboardFocus="TextBox_GotKeyboardFocus" GotMouseCapture="TextBox_GotMouseCapture" IsReadOnly="False"  Text="{Binding Path=Quantity, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, Converter={StaticResource RemoveDoubleZero}}"  />
                </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>

        <DataGridTemplateColumn   Header="PU"  Width="150" >
            <DataGridTemplateColumn.CellTemplate >
                <DataTemplate>
                    <TextBox  Margin="10,0" HorizontalAlignment="Center" IsReadOnly="False" GotKeyboardFocus="TextBox_GotKeyboardFocus" GotMouseCapture="TextBox_GotMouseCapture"  Text="{Binding Path=UnitePrice, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, Converter={StaticResource RemoveDoubleZero}}"  />
                </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>

        <DataGridTemplateColumn Header="Montant HT"  Width="150" >
            <DataGridTemplateColumn.CellTemplate >
                <DataTemplate>
                    <TextBlock Margin="10,2" HorizontalAlignment="Right" Text="{Binding Path=Line_Total,Mode=TwoWay,ValidatesOnExceptions=True,ValidatesOnDataErrors=True, StringFormat=n, ConverterCulture=fr-FR}" />
                </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
        </DataGridTemplateColumn>

    </DataGrid.Columns>
</DataGrid>

Here is the CurrentCellChangedCommand excute method in the ViewModel (SelectedItem is an EF Entity):

private void RecalculateLineTotal()
{
    if (SelectedItem != null)
    SelectedItem.Line_Total = SelectedItem.Quantity * SelectedItem.UnitePrice;
}

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:01:23+00:00Added an answer on June 10, 2026 at 11:01 am

    It started to work normally after sometime. I think that was something extra prevented those Key stroks from working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have this code to decode numeric html entities to the UTF8 equivalent character.
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.