0
많은 온라인 자습서에도 불구하고이 방법이 어떻게 작동하는지 아직 이해하지 못했습니다. 사용자가 행당 주소를 입력 할 수있는 radgridview가 있습니다. 먼저 우편 번호를 입력하라고합니다. 도시와 주정부는 우편 번호와 일치하는 데이터베이스에서 제공됩니다. 따라서 우편 번호가 입력되는 즉시 radgridview를 업데이트해야합니다.ObservableCollection 및 INotifyPropertyChanged를 사용하는 WPF Radgridview
INotifyProperty를 사용하는 것이 좋습니다. 컬렉션을 업데이트 할 수는 있지만 업데이트 할 DataGrid를 가져올 수 없습니다.
보기 모델 :
Dim shipCS As New ShipTo
shipCS.shipCity = GetCityAndState.CityLookup(CStr(CType(dgShippingAddresses.SelectedItem, ShipTo).shipZip))
shipCS.shipState = GetCityAndState.StateLookup(CStr(CType(dgShippingAddresses.SelectedItem, ShipTo).shipZip))
XAML :
Public Class ShipTo
Implements INotifyPropertyChanged
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
Private Sub NotifyPropertyChanged(ByVal info As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(info))
End Sub
Public Property shipAddressType As String = String.Empty
Public Property orderID As String = String.Empty
Public Property shipName As String = String.Empty
Public Property shipAddr1 As String = String.Empty
Public Property shipAddr2 As String = String.Empty
Private _shipCity As String
Public Property shipCity As String
Get
Return _shipCity
End Get
Set(value As String)
_shipCity = value
NotifyPropertyChanged("shipZip")
End Set
End Property
Private _shipState As String
Public Property shipState As String
Get
Return _shipState
End Get
Set(value As String)
_shipState = value
NotifyPropertyChanged("shipZip")
End Set
End Property
Public Property shipZip As String = String.Empty
코드 도시와 국가를 찾을 수
도움을 주시면 감사하겠습니다. 감사.
응답이 없기 때문에 나는 기초가 떨어져서 파기를 계속해야한다고 생각합니다. – EManning