Hello,
The requirement is to enter the edit mode of the cell on MouseUp.
What I did is:
<igDP:XamDataGrid.FieldSettings>
And then I register on XamDataGrid's PreviewMouseUp event and trying to figure out what cell was under the mouse when the MouseUp occured:
void xamDataGridPreviewMouseUp(object sender, MouseButtonEventArgs e)
{
DependencyObject source = e.OriginalSource as DependencyObject;
i
cvp.StartEditMode();
}
The problem is that cvp is always null.
Is there some other way to figure out what Cell was under the mouse on MouseUp?
This should be running correctly if you do not set the CellClickAction to Select Cell. If the CellClickAction is select cell, the OriginalSource will be the XamDataGrid and not the underlying editor in the cell. This is why calling the GetAncestorFromType always returns a null CellValuePresenter.
What you can do is start the edit mode and then select the cell if you need to.
Alex,
when I don't set the CellClickAction to CellSelect, the Cell enters the EditMode on Mouse Down, but I need it to be Selected on Mouse Down and entering the EditMode only on MouseUP.
So you're saying I can start the edit mode on the cell but how do I figure out what cell was actually clicked on MouseUp? (this was the original question)
Using your code, I am getting the expected result when testing - just without setting the CellClickAction as you have dones in your initial post. You should be getting the CellValuePresenter using GetAncestorFromType method from the e.OriginalSource. If not, please provide us with a sample that reproduces the issue as well as information about the exact version of the dlls that you are using.