Home Forums WPF controls Xceed Toolkit Plus for WPF TimePicker format=custom and formatstring binded to a property throws exception

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • rashmi
    Participant
    Post count: 2
    #44849 |

    TimePicker throws exception ‘Index was out of range. Must be non-negative and less than the size of the collection.’

    when Format=Custom and FormatString=”{Binding TimePattern}”

    TimePattern is a string type property which sets time format either to 12 hour or 24 hour through code.
    12 hour format —> hh:mm tt
    24 hour format —-> HH:mm

    xaml code

    <xctk:TimePicker Name="dtJobEndTime" Foreground="#333333" FontFamily="Arial, sans-serif" Style="{StaticResource TimePickerValidationStyle}" Width="100" ShowButtonSpinner="False" IsEnabled="{Binding IsPricePageGeneralInfoEnabled}" Format="Custom" Margin="0,0,0,0" HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch" Value="{Binding Path= TempJobStartTime, Converter={StaticResource dateTimeToStringConverter}, Mode=TwoWay, ValidatesOnDataErrors=True, UpdateSourceTrigger=LostFocus}" FormatString="{Binding TimePattern}"/>

    view model code

    public DateTime? TempJobStartTime
    {
    get { return this.tempJobStartTime; }
    set
    {
    this.tempJobStartTime = value;
    this.RaisePropertyChanged(() => this.TempJobStartTime);
    }
    }
    public string TimePattern
    {
    get
    {
    return timePattern;
    }
    set
    {
    timePattern = value;
    this.RaisePropertyChanged(() => this.TimePattern);
    }
    }

    Currently we are using xceed toolkit for wpf 3.0.0.0
    also tried using the latest version 3.4.17280.14430 but this is throwing xaml parse exception on window load.

    Please look in to this issue and provide a solution to it.

    rashmi
    Participant
    Post count: 2

    Hello,

    Is there any solution for this issue?
    Please do reply to the query soon.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.