Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NumericUpDown didn't update when lost focus, StringFormat has no effect to the content string #3026

Closed
ShannonZ opened this issue Aug 23, 2017 · 17 comments
Labels
Milestone

Comments

@ShannonZ
Copy link

NumericUpDown didn't update

I‘ve wrote an simple solution to demonstrate this issue download code.

Value of NumericUpDown(NUD) was bonded to the field of Model class
-public float Age { set; get; }
And the StringFormat of NUD was set as
-StringFormat="{}{0:N6} ms"

if one typed something like "9.87654321" and tab to another control, the content of NUD will still be "9.87654321", not the exact one "9.876543 ms"

The thing is quirk because the NUD used in the offical demo solution (right-bottom in the Text tab) present well. If you input "9.87654321" and then change the focus, the content of NUD will update as expected immediately.

Environment

  • MahApps.Metro v1.5.0
  • Windows OS win7 x64
  • Visual Studio 2015
  • .NET Framework 4.5
  • Reference SoftFluent.Windows
@punker76
Copy link
Member

@ShannonZ I can not reproduce this with the v1.5.0 of MahApps.

numericupdown_3026

@ShannonZ
Copy link
Author

just type more digits to call up the Horizotal Scrollbar of NUD.

@ShannonZ
Copy link
Author

@ShannonZ I can not reproduce this with the v1.5.0 of MahApps.

I have done this experiment in another two computers with VS2015 installed, but the problem is still exist.
Is is possible to relate with cultureinfo?

@ShannonZ
Copy link
Author

1

@punker76
Copy link
Member

@ShannonZ where/what is the code of this?

@ShannonZ
Copy link
Author

@punker76 The solution attached in the first floor has the same problem.
Solution

@punker76
Copy link
Member

@ShannonZ In this sample you set StringFormat="0" if I set it to StringFormat="{}{0:N6} ms" it works for me™.

@ShannonZ
Copy link
Author

@punker76 Have you input enough digits? Have you seen the horizontal scrollbar?

@ShannonZ
Copy link
Author

The new

@ShannonZ
Copy link
Author

How to update the content of NUD programmatically?

@punker76
Copy link
Member

@ShannonZ to hide the scrollbars do this on your NumericUpDown

ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden"

@punker76
Copy link
Member

@ShannonZ íf there is no other tabable control the tab doesn't work

@ShannonZ
Copy link
Author

Can the problem be reproduce at your computer?
In my office, only if inputting excessive precision the content of NUD won't be update any more.
But the button(+/-) can work perfectly. Is it possible to call the Click callback of + programtocally? Succeeding with a calling of Click callback of -.

@punker76
Copy link
Member

@ShannonZ I'm investigating what's wrong with this

@ShannonZ
Copy link
Author

@punker76 Has it been fixed?

@ShannonZ
Copy link
Author

@punker76 Is there any temporary solution?
Sorry to disturb you so frequently but I myself cannot solve it.

@punker76 punker76 added the Bug label Aug 31, 2017
@punker76 punker76 added this to the 1.6.0 milestone Aug 31, 2017
@punker76
Copy link
Member

@ShannonZ Should be fixed now with bd5b84f, available in 1.6.0 (and upcoming alpha)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants