I have a very strange problem that someone may be able to give a hint about. I am capturing the KeyDown events for the XamNumericEditor, if the key is a +-*or /, I pop a calculator and paste it's results into the value of the XamNumericEditor.Works great if the XamNumericEditor is standalone. If it's in a datagrid and I change focus to another cell and back serveral times, the original value comes back in the cell.It's as if the new data has not been passed to the bound data and the datagrid has refreshed itself.Is there another event that I have to fire after the endEditMode to ensure 'everybody' knows about the 'pasted' data? <Style x:Key="XamNumericEditor" TargetType="{x:Type igEditors:XamNumericEditor}" > <EventSetter Event="PreviewKeyDown" Handler="xamNumericEditor1_PreviewKeyDown"/> <Setter Property="Mask" Value="nn,nnn.nnnn"/> </Style> private void xamNumericEditor1_PreviewKeyDown(object sender, KeyEventArgs e) { XamNumericEditor xx = (XamNumericEditor)sender; if (e.Key == Key.Add || e.Key == Key.Subtract || e.Key == Key.Multiply || e.Key == Key.Divide) { try { var jj = xx.Value.ToString(); float val = float.Parse(jj); calc1 ss = new calc1(val, e.Key); ss.ShowDialog(); xx.Value = ss.result; xx.Text = ss.result.ToString(); xx.EndEditMode(true,true); e.Handled = true; } catch { } } }
Thanks in advance...
I can't really say what is happening without seeing the behavior. Can you provide a sample that demonstrates the issue?
While puting a small demo together I found the cause. I had to:
StartEditMode()
set the value
EndEditMode().
I was not doing the StartEditMode() before.
Thanks for looking...