This is a migrated thread and some comments may be shown as answers.

Binding numericupdown to an array

1 Answer 82 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
Josh Jones
Top achievements
Rank 1
Josh Jones asked on 09 Aug 2011, 06:23 PM
Hi,
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:
VB:
Private m_Scores As New ObservableCollection(Of Double) 
Public Property Score(ByVal index As IntegerAs Double
    Get
        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
XAML:
<telerik:RadNumericUpDown Name="RadNumericUpDown1" Value="{Binding Path=Score[0]}"/> 
<telerik:RadNumericUpDown Name="RadNumericUpDown2" Value="{Binding Path=Score[1]}"/>
etc.

Can anyone point me in the right direction?

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 10 Aug 2011, 01:28 PM
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,

Greetings,
Yana
the Telerik team

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

Tags
NumericUpDown
Asked by
Josh Jones
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or