I'd like to bind xamDataGrid rows to an IsSelected property in my ViewModel, so I did this:
<Style TargetType="{x:Type igDP:DataRecordPresenter}">
<EventSetter Event="MouseLeftButtonUp" Handler="object_MouseLeftClick"/> <EventSetter Event="MouseDoubleClick" Handler="object_MouseDoubleClick"/> <EventSetter Event="MouseRightButtonUp" Handler="object_MouseRightClick"/> <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
</Style>
Hello,
Thank you for your post. I have been looking through it and I can say that if you didn’t set the XamDataGrid’s FieldSettings’ CellClickAction Property, its default value is EnterEditModeIfAllowed, which means that the Record is only selected if you click the RecordSelector at the beginning of the Row. If you then click at the Record itself, it becomes Unselected again. Please let me know if need further clarifications on this matter.
Looking forward for your reply.
Well, I added the following to my grid:
<igDP:XamDataGrid.FieldSettings> <igDP:FieldSettings CellClickAction="SelectRecord"/> </igDP:XamDataGrid.FieldSettings>
I know this is not a problem with the code of the viewmodel, because I have successfully bound IsSelected in the same viewmodel with a ListBox and a ListView.