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

Comments

Projects
None yet
2 participants
@ShannonZ

ShannonZ commented Aug 23, 2017

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

This comment has been minimized.

Member

punker76 commented Aug 23, 2017

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

numericupdown_3026

@ShannonZ

This comment has been minimized.

ShannonZ commented Aug 24, 2017

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

@ShannonZ

This comment has been minimized.

ShannonZ commented Aug 24, 2017

@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

This comment has been minimized.

ShannonZ commented Aug 24, 2017

1

@punker76

This comment has been minimized.

Member

punker76 commented Aug 24, 2017

@ShannonZ where/what is the code of this?

@ShannonZ

This comment has been minimized.

ShannonZ commented Aug 24, 2017

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

@punker76

This comment has been minimized.

Member

punker76 commented Aug 24, 2017

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

@ShannonZ

This comment has been minimized.

ShannonZ commented Aug 24, 2017

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

@ShannonZ

This comment has been minimized.

ShannonZ commented Aug 24, 2017

@ShannonZ

This comment has been minimized.

ShannonZ commented Aug 24, 2017

How to update the content of NUD programmatically?

@punker76

This comment has been minimized.

Member

punker76 commented Aug 24, 2017

@ShannonZ to hide the scrollbars do this on your NumericUpDown

ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden"
@punker76

This comment has been minimized.

Member

punker76 commented Aug 24, 2017

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

@ShannonZ

This comment has been minimized.

ShannonZ commented Aug 24, 2017

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

This comment has been minimized.

Member

punker76 commented Aug 24, 2017

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

@ShannonZ

This comment has been minimized.

ShannonZ commented Aug 28, 2017

@punker76 Has it been fixed?

@ShannonZ

This comment has been minimized.

ShannonZ commented Aug 28, 2017

@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 punker76 closed this in bd5b84f Aug 31, 2017

@punker76

This comment has been minimized.

Member

punker76 commented Aug 31, 2017

@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