Different styles for selected item - Combobox RRS feed

  • Question

  • Hi there,
    I want to do a control that basically looks like google analytics control for selecting periods, a combobox which displas a time period when it is in the collapsed state and when opened up it would show various date pickers.

    I have problems in understanding how i shall customize the style for the combox to only show the time period when selected, at the moment, when i have selected a period in my date selector, the whole date selector control i displayed in the combox toogle button, and is of course completley wrong, it should only show a string representing the time span.

    So anyone knows how to modiyf the control template when the control is collapsed to show a string from a property in my datacontext and not the whole control that i have in my itemsource?



    Thursday, March 25, 2010 6:04 PM


  • Hi,

       I am not 100% sure if i get you correct.

       I assume in your items you have a datepicker? You want to show it's selected date?

      Then how about the SelectedValuePath property of ComboBox.(MemberValuePath?) 

      If this cant satisfy you , you may need to define a value converter.

      This way you can have more thorough control over it.

    Best Regards

    Monday, March 29, 2010 3:18 AM