Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Commented Issue: IntegerUpDown 'Text' is empty when 'Value' equals to the 'DefaultValue' [21203]

$
0
0
Initializing IntegerUpDown control with Value == DefaultValue results in empty Text field.
This is probably due to the addition of:

```
bool shouldKeepEmpty = !forceTextUpdate && string.IsNullOrEmpty( Text ) && object.Equals( Value, DefaultValue ) && !this.DisplayDefaultValueOnEmptyText;
```

In UpDownBase class under "SyncTextAndValueProperties" method.

A workaround is to set DisplayDefaultValueOnEmptyText="True".

Sample code to demonstrate the problem:

#View -
```
<xctk:IntegerUpDown Minimum="1" Maximum="300" DefaultValue="30" Value="{Binding SampleData}"></xctk:IntegerUpDown>
```

#ViewModel - (should be initialized with 'SampleData' equals to 30)
```
DataContext = _dataContext;
_dataContext.SampleData = 30;
```

#Result -
UpDownControl with empty text field.

If the default value is different than 30, or DataContext's 'SampleData' property is initialized with value other than the DefaultValue, the Text field is shown.
Comments: ** Comment from web user: BoucherS **

This issue will be fixed in v2.4.


Viewing all articles
Browse latest Browse all 4964

Trending Articles