WPF Combobox: Different template in textbox and drop-downlist

前端 未结 5 1259
面向向阳花
面向向阳花 2020-11-29 05:25

This is my combo-box.

    

        
5条回答
  •  感情败类
    2020-11-29 06:13

    Unfortunately, the SelectionBoxItemTemplate is a readonly property, so we have to do a bit more work. By doing the ItemTemplate to be how you want the item to appear when selected, you can edit the ItemContainerStyle to provide a ControlTemplate that includes the other fields you want to display.

    
        
            
                
        
        
            
        
    
    

    For the ComboBoxItem template, I just modified the default one, so it should be fully functional.

提交回复
热议问题