Skip to content

Replies

0
Gary Wrinn
Gary Wrinn answered on Aug 6, 2014 3:42 PM

Hi Stefan, I more or less implemented the solution you posted except I used

!((Cell)curvesGrid.ActiveCell).IsEditing

instead of the isEditing flag and CellExitedEditMode callback to determine if the cell was already in edit mode.  I am not using Silverlight, so I had to do something else for the conversion from key press to actual character.  I am also using a XamCurrencyEditor instead of a textbox, so I had to use:

editor.SelectionStart = editor.TextLength - cursorLocation;
editor.SelectionLength = 0;

instead of the textbox Select() method.  the only issue I have left is to figure out how to get the XamCurrencyEditor to display a "-" when the user types it (the editor is bound to a decimal in the background).

As far as the subject of this original post goes, your example works, but I was looking for a less clunky version (the dispatched/thread/sleep part to clear the selection is really getting out there).

Thanks!

0
Gary Wrinn
Gary Wrinn answered on Aug 5, 2014 7:13 PM

I am interested in knowing how to do this as well.  I have attempted a similar solution based on this post and some others, but the hang up still seems to be getting the first key pressed passed in to the text field.