I have a RadSpinEditor where i type some values; Every time when i type a number in the RadSpinEditor, an event for a radPanel_Paint is running; After every type on the RadSpinEditor, the cursor jumps on the first position, so i can't type 13 because when i press 1 the cursor goes on the first position so it will be 31; It's something like this:
private void radSpinEditor_KeyUp(object sender, KeyEventArgs e)
{
this.radPanel.Refresh()
}
private void radPanel_Paint(object sender, PaintEventArgs e)
{
decimal x = this.radSpinEditor.Value;
//then i draw a rectangle with this x and some other variables
}
Found the reason of this problem and how to solve it. I don't know if this is the best way to do it, but for my case it works.
When the value from RadSpinEditor is read, somehow the Text is changed so it gets adjusted by the control.
Solution:
private void radSpinEditor_KeyUp(object sender, KeyEventArgs e)
{
this.radPanel.Refresh()
}
private void radPanel_Paint(object sender, PaintEventArgs e)
{
decimal x = decimal.Parse(this.radSpinEditor.GetPlainText());
//then i draw a rectangle with this x and some other variables
}
Using the radSpinEditor.GetPlainText() and then parse the text to decimal seems to solve the problem.