I have a behavior that changes cells in a column to edit mode when it becomes active.
If I am using the mouse to drag a selection of cells, as soon as I enter a cell that changes to edit mode, all the selection is lost.
Is there a way to maintain selection of all cells (including the cell that just changed to edit mode) when a cell changes to edit mode?
Hi,
I continued to look for similar postings in the net and found following on stakeoverflow: https://stackoverflow.com/questions/17973652/xamdatagrid-selecteditems-empty-on-click-on-editable-cell
Using the EditModeStarting Event kept the SelectedDataItem ok, but lost it on ending the edit mode.
I started to use the ActiveDataItem instead and bound the SelectedDataItem in one way mode to highlight the selected row.
Niko
Hello Rob,
I was searching for this topic, tried to apply your second example but could not get it done. Maybe my question is slightly different - even when I don't see it.
A XamDataGrid is holding a number of columns, some of them are editable. They are XamComboEditor and a DateTimeEditor.
The SelectedDataItem is bound to the ViewModel and also set there.
<igDP:XamDataGrid Name="Auftraege" DataSource="{Binding Auftraege, UpdateSourceTrigger=PropertyChanged}" SelectedDataItemsScope="RecordsOnly" Grid.Column="0" Grid.Row="1" Grid.RowSpan="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" GroupByAreaLocation="AboveDataArea" TabIndex="31" InitializeRecord="InitializeRecord" SelectedDataItem="{Binding CurrentAuftrag, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" EditModeStarting="xamDataGridAuftraege_EditModeStarting" PreviewMouseLeftButtonDown="xamDataGridAuftraege_PreviewMouseLeftButtonDown" SelectedItemsChanged="xamDataGridAuftraege_SelectedItemsChanged">
I would like to keep the SelectedDataItem unchanged during the editmode. At this point in time starting the editmode changes the SelectedDataItem.
As a second question: Is it also possible to keep the SelectedDataItem unchanged when using the filter fields? Does this even make sense from XamDataGrids concept?
What is the best way to achieve this?
Thanks
Hi rbccm,
Have you had a chance to look at this yet? Let me know if you have any further questions.
Hope you had a good vacation! If you have any questions please let me know.
I was out on vacation the past 2 weeks. I will be looking at this in the next few days.