DoubleUpDown behaviour when ClipValueToMinMax = false

Open
#1,801 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
desktop

Research direction

Start with the DoubleUpDown control and reproduce the reported case using Min=0, Max=20000, ClipValueToMinMax=false, and UpdateSourceTrigger=LostFocus. Trace validation and source-update behavior when an out-of-range value loses focus. Done means the bound property remains unchanged and the displayed value reverts to the current valid value.

Written by the indexing model from the issue text.

Description

I have a DoubleUpDown control bound to a VM property using 'UpdateSourceTrigger=LostFocus'. When ClipValueToMinMax=false, typing an out of range value then tabbing away seems to result in one or more digits being removed from the end of the value to bring it within the Min/Max range. For example if Max=20000, entering a value of (say) 123456 results in the VM property being set to 12345. Similarly if I enter 1234567 then two digits are removed and the VM property is again set to 12345. This solution is confusing users as it can result in "random" values being applied.

Could the control's behaviour be changed such that if I enter an out of range value then tab away, the VM property does not get updated and the on-screen value reverts to the current (valid) value. I appreciate that this becomes more difficult/impractical when UpdateSourceTrigger=PropertyChanged (although this isn't a problem for me personally, as I always use LostFocus).

I'm using v4.6.0 community edition under .Net 6.

Dominant language
C#
Stars
4.2k
Forks
912
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from xceedsoftware/wpftoolkit

All issues in xceedsoftware/wpftoolkit

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.