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

valueconvert lookup ItemsSource

1 Answer 37 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 18 Nov 2012, 06:57 AM
Hi,

I have a requirement where a user enters data for a shift. I don't what them to select the time of the shift otherwise I would get all sorts of times. So I've placed a datepicker and a combobox on the screen. The user will then select the date and the shift from the combobox. The combobox's ItemSource is bound to an entityset that contains the Name, ShiftStartTime and ShiftEndTime. The SelectedValue is bound to a datetime. What I need to do is perform a simple lookup against the ItemSource. I'm attempting to using a valueconverter to do this but I don't see an easy way of accessing the ItemsSource collection.

1 Answer, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 21 Nov 2012, 08:08 AM
I'm answering my own question.

It isn't possible to do what I was trying. There is no way to get the ItemsSource entity set in the valueconverter. So I worked around this by creating a reference to the lookup table in my model.
Tags
ComboBox
Asked by
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Share this question
or