I'm using MVVM along with this template:
<Style TargetType="{x:Type igDP:DataRecordPresenter}">
<Setter Property="IsSelected"
Value="{Binding DataItem.IsSelected, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</Style>
and I have a IsSelected property in my viewmodel:
Private _IsSelected As Boolean
Public Property IsSelected() As Boolean
Get
Return _IsSelected
End Get
Set(ByVal value As Boolean)
If value = _IsSelected Then
Return
End If
_IsSelected = value
OnPropertyChanged("IsSelected")
End Set
End Property
Selection tracking seem to work fine until you scroll the grid and then random items become selected and selected items lose there selection. I can see this by showing the IsSelected property field on the grid. Is there something I'm doing wrong?
HI,
I am just following up on this forum thread.
Please let me know if you need further assistance. Sincerely, Matt Developer Support Engineer
This will not work. The control maintains a selectedrecord collection – RecordPresenters only exist for each record in view. If you scroll the records our of view , the control doesn’t know what was selected.
I am going to submit a feature request for the XamDataGrid to expose a property that the control would use to keep the IsSelected of the record and some property on the dataitem in sync
Sincerely,
MattDeveloper Support Engineer