valueconvert lookup ItemsSource

2 posts, 0 answers
  1. Michael
    Michael avatar
    13 posts
    Member since:
    Mar 2012

    Posted 18 Nov 2012 Link to this post

    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.

  2. Michael
    Michael avatar
    13 posts
    Member since:
    Mar 2012

    Posted 21 Nov 2012 Link to this post

    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.
  3. DevCraft banner
Back to Top