In method 'protected override void OnValueChanged(' of Main\Source\ExtendedWPFToolkitSolution\Src\Xceed.Wpf.Toolkit\DateTimeUpDown\Implementation\DateTimeUpDown.cs' class, following statement
```
if( info == null)
info = (this.CurrentDateTimePart != DateTimePart.Other) ? this.GetDateTimeInfo( this.CurrentDateTimePart ) : _dateTimeInfoList[ 0 ];
```
was throwing this Index-Out-Of-Range exception.
It is because the '_dateTimeInfoList' had no elements in it (i.e. Length=0), and it was trying to access its first element.
I've fixed it by applying a check '_dateTimeInfoList.Count > 0' before using '_dateTimeInfoList[0]'.
Following is the complete block of code replacing the above code block which fixes the issue:
```
if (info == null)
{
if (this.CurrentDateTimePart != DateTimePart.Other)
{
info = this.GetDateTimeInfo(this.CurrentDateTimePart);
}
else
{
if (_dateTimeInfoList.Count > 0)
{
info = _dateTimeInfoList[0];
}
}
}
```
Comments: ** Comment from web user: BoucherS **
```
if( info == null)
info = (this.CurrentDateTimePart != DateTimePart.Other) ? this.GetDateTimeInfo( this.CurrentDateTimePart ) : _dateTimeInfoList[ 0 ];
```
was throwing this Index-Out-Of-Range exception.
It is because the '_dateTimeInfoList' had no elements in it (i.e. Length=0), and it was trying to access its first element.
I've fixed it by applying a check '_dateTimeInfoList.Count > 0' before using '_dateTimeInfoList[0]'.
Following is the complete block of code replacing the above code block which fixes the issue:
```
if (info == null)
{
if (this.CurrentDateTimePart != DateTimePart.Other)
{
info = this.GetDateTimeInfo(this.CurrentDateTimePart);
}
else
{
if (_dateTimeInfoList.Count > 0)
{
info = _dateTimeInfoList[0];
}
}
}
```
Comments: ** Comment from web user: BoucherS **
Hi,
Which version of the Toolkit are you using ?
Can you submit a scenario where this situation is happening ?
I believe this has already been fixed in latest versions.
Thanks.
――――
_Get more controls, features, updates and technical support with [Xceed Toolkit Plus for WPF](https://wpftoolkit.codeplex.com/wikipage?title=Compare%20Editions)_