I want to be able to enter edit mode in a cell in XAMDatagrid with single click and also be able to select multiple cells by Dragging (ExtendedAutoDrag) .Currently, I can either enter the cell in a edit mode with a single click or select multiple cells by dragging but not both.
Is there a way I can do both?
Hello Ashish,
These these steps should will allow you to replicate this:
First hook the grids SelectedItemsChanged event
1. Set CellClickAction to SelectCell
2. Make your selection
3. Get the active cell via. this.grid.ActiveCell in the SelectedItemsChanged event
4. Force that cell into edit mode in SelectedItemsChanged event.
this.grid.ExecuteCommand(DataPresenterCommands.StartEditMode);
As soon as I do that I am unable to select multiple cells, is there a way I can just make a single cell in edit mode and later be also able to select multiple cells?
When CellClickAction is set to default, a clicked cell will automatically enter edit mode if allowed. SelectCell requires an additional click to allow multiple selection. You cannot do both simultaneously. These features are mutually exclusive.
There are ways around this by writing a Behavior to keep track of your selected cells while in edit mode.
eg.
https://www.infragistics.com/community/forums/f/ultimate-ui-for-wpf/94761/selection-lost-when-a-cell-changes-to-edit-mode
When CellClickAction is set to default, it is not even selecting multiple cells with mouse click as whichever cell is clicked enters edit mode. Only way to select multiple cells once CellClickAction is in default is Shift + Up or Down arrow. But that also works from the next cell leaving out the active cell.