Binding numericupdown to an array

2 posts, 0 answers
  1. Josh Jones
    Josh Jones avatar
    1 posts
    Member since:
    Nov 2009

    Posted 09 Aug 2011 Link to this post

    I'm trying to bind (two way) ten numericupdown elements to an array of ten Doubles, i've tried every method but just cannot get it to work - here is my latest attempt:
    Private m_Scores As New ObservableCollection(Of Double) 
    Public Property Score(ByVal index As IntegerAs Double
            Return m_Scores.Item(index)
        End Get
        Set(ByVal Value As Double) m_Scores.Item(index) = Value
            RaiseEvent PropertyChanged(MeNew PropertyChangedEventArgs("Score(" & index & ")"))
        End Set
    End Property
    <telerik:RadNumericUpDown Name="RadNumericUpDown1" Value="{Binding Path=Score[0]}"/> 
    <telerik:RadNumericUpDown Name="RadNumericUpDown2" Value="{Binding Path=Score[1]}"/>

    Can anyone point me in the right direction?
  2. Yana
    Yana avatar
    4547 posts

    Posted 10 Aug 2011 Link to this post

    Hello Josh,

    I would suggest to use ValueConverter in order to get the needed value from the array. Please check this article for more details about IValueConverter interface,

    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. DevCraft R3 2016 release webinar banner
Back to Top