<DataGrid AutoGenerateColumns="False" Grid.Row="4" Grid.Column="1" Height="Auto" HorizontalAlignment="Stretch" Margin="0" Name="grdCashReceipts" VerticalAlignment="Stretch" Width="Auto" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Mode=default}" SelectionMode="Single" GridLinesVisibility="None" HeadersVisibility="Column" Grid.ColumnSpan="2" CanUserAddRows="False" CanUserDeleteRows="False" SelectionUnit="Cell" Grid.RowSpan="2" CellEditEnding="grdCashReceipts_CellEditEnding" AlternatingRowBackground="LightGray"> <DataGrid.Resources> <Style x:Key="AlignRight" TargetType="DataGridCell"> <Setter Property="HorizontalAlignment" Value="Right" /> </Style> <Style x:Key="AlignRightHeader" TargetType="DataGridColumnHeader"> <Setter Property="HorizontalAlignment" Value="Right" /> </Style> </DataGrid.Resources> <DataGrid.Columns> <DataGridTextColumn Header="Invoice #" Width="*" Binding="{Binding crt_invfk, Converter={StaticResource Inv_PkToNumberConverter}}" x:Name="txtInv_Number" IsReadOnly="False"/> <DataGridTextColumn Header="Invoice Date" Width="*" Binding="{Binding crt_invfk, Converter={StaticResource Inv_PkToInvoicePropertyConverter}, ConverterParameter='inv_date', Mode=OneWay, StringFormat=d}" IsReadOnly="True"/> <DataGridTextColumn Header="Amount" Width="*" Binding="{Binding crt_amount, Mode=default}" CellStyle="{StaticResource AlignRight}" HeaderStyle="{StaticResource AlignRightHeader}"/> </DataGrid.Columns> </DataGrid>After I enter a value in the Amount column and try to move from the textbox, I get the error: Two way binding requires Path or XPath.
private void grdCashReceipts_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e) { if (!this.manualEditEnding) { this.manualEditEnding = true; if (this.CashReceipt.Entity.crt_invfk == null || this.CashReceipt.Entity.crt_invfk == Guid.Empty) { // need to make sure we are on a textbox and that we are on the txtinv_number textbox var editedTextbox = e.EditingElement as TextBox; if (editedTextbox != null) { string invNumber = editedTextbox.Text; int invoiceNumber = 0; bool result = Int32.TryParse(invNumber, out invoiceNumber); if (invoiceNumber > 0) { InvoiceEntity invoice = this.InvoiceLookup.GetAvailableInvoiceByNumber(invoiceNumber); //this.CashReceipt.Entity.inv_number); if (invoice.inv_pk == Guid.Empty) { mmAppWPF.MessageBox.Show("This Invoice either does not exist or payment was already received.", "New Receipt", MessageBoxButton.OK, MessageBoxImage.Information); editedTextbox.Text = "0"; } else { this.CashReceipt.Entity.crt_invfk = invoice.inv_pk; } //this.CashReceipt.Entity.inv_date = invoice.inv_date; } } } this.grdCashReceipts.CommitEdit(DataGridEditingUnit.Row, true); this.manualEditEnding = false; } }The error occurs on this line in the above code: