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

wpf datagrid combo iNotifyPropertyChange not firing

$
0
0

When an item is selected from the combobox, the property changed event does not get fired.

Xaml:

<DataGridTemplateColumn Header="CPT Code" Width="75"><DataGridTemplateColumn.CellTemplate><DataTemplate><ComboBox ItemsSource="{Binding PartBCombo, 
                                        RelativeSource={RelativeSource AncestorType=Window}}" 
                                        DisplayMemberPath="PartBLookup_CPTCode" 
                                        SelectedValuePath="PartBLookup_ProcedureDescription"  
                                        SelectedValue="{Binding PartBBilling_ProcedureName, UpdateSourceTrigger=PropertyChanged}"
                                        SelectedItem="{Binding PartBBilling_CPT}"/></DataTemplate></DataGridTemplateColumn.CellTemplate></DataGridTemplateColumn>

Property for combobox:

Imports System

Namespace DentalDB

    Public Class PartBBilling_Combobox

        Private _PartBLookup_CPTCode As String
        Public Property PartBLookup_CPTCode As String
            Get
                Return _PartBLookup_CPTCode
            End Get
            Set(value As String)
                _PartBLookup_CPTCode = value
            End Set
        End Property

        Private _PartBLookup_ProcedureDescription As String
        Public Property PartBLookup_ProcedureDescription As String
            Get
                Return _PartBLookup_ProcedureDescription
            End Get
            Set(value As String)
                _PartBLookup_ProcedureDescription = value
            End Set
        End Property

    End Class

End Namespace

Property for datagrid:

Imports System.ComponentModel

Namespace DentalDB

    Public Class PartBBilling
        Inherits PropertyChangedBase

        Public Sub New()
            Me.PartBBilling_Date = DateTime.Now
        End Sub

        Private _PartBBilling_RW As Integer
        Public Property PartBBilling_RW As Integer
            Get
                Return _PartBBilling_RW
            End Get
            Set(value As Integer)
                _PartBBilling_RW = value
            End Set
        End Property

        Private _PartBBilling_Date As Date
        Public Property PartBBilling_Date As Date
            Get
                Return _PartBBilling_Date
            End Get
            Set(value As Date)
                _PartBBilling_Date = value
                RaisePropertyChanged("PartBBilling_Date")
            End Set
        End Property

        Private _PartBBilling_CPT As String
        Public Property PartBBilling_CPT As String
            Get
                Return _PartBBilling_CPT
            End Get
            Set(value As String)
                _PartBBilling_CPT = value
                RaisePropertyChanged("PartBBilling_CPT")
            End Set
        End Property

A breakpoint on the code "_PartBBilling_CPT = value" shows that this doesn't get fired when an item is selected from the combo.

Sample data:

if D00240 changed to another item, the code doesn't fire like I expect it to.




Thanks.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



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