In such a case, you need to integrate the checkbox list or the Treeview list in ComboBox to facilitate your selection and provide a good UI experience.
Before starting to process, let's take a look at the basics of ComboBox, that is, writing in XAML (I use the ComboBox control dragged out by blend3, and there will be more redundant code)
1. Basic Application of The ComboBox control
Code
<! -- Test the common ComboBox -->
<ComboBox horizontalalignment = "Left" margin = "120," verticalignment = "TOP" width = "">
<Comboboxitem content = "test data 1"/>
<Comboboxitem content = "Test Data 2"/>
</ComboBox>
<! -- ComboBox Embedded rectangle control -->
<ComboBox margin = "120, 53," verticalalignment = "TOP" horizontalalignment = "Left" width = "">
<Comboboxitem>
<Comboboxitem. content>
<Rectangle width = "200" Height = "30" fill = "blue"/>
</Comboboxitem. content>
</Comboboxitem>
<Comboboxitem>
<Comboboxitem. content>
<Rectangle width = "200" Height = "30" fill = "red"/>
</Comboboxitem. content>
</Comboboxitem>
<Comboboxitem>
<Comboboxitem. content>
<Rectangle width = "200" Height = "30" fill = "green"/>
</Comboboxitem. content>
</Comboboxitem>
</ComboBox>
<! -- ComboBox Embedded checkbox control -->
<ComboBox margin = "365, 53, 120" verticalalignment = "TOP" horizontalalignment = "Left" width = "">
<Comboboxitem>
<Comboboxitem. content>
<Checkbox content = "test data 1"/>
</Comboboxitem. content>
</Comboboxitem>
<Comboboxitem>
<Comboboxitem. content>
<Checkbox content = "Test Data 2"/>
</Comboboxitem. content>
</Comboboxitem>
<Comboboxitem>
<Comboboxitem. content>
<Checkbox content = "Test Data 3"/>
</Comboboxitem. content>
</Comboboxitem>
</ComboBox>
References:
Silverlight ComboBox tutorial
Learn Silverlight 2 series articles step by step
2. ComboBox integrated checkbox list
As you can see in the above XAML code, we can embed the checkbox into the comboboxitem container, but this can only be a test and play, and the specific application is not feasible.
Because there are already some experts on the Internet to write a solution, both from the application perspective and from the perspective of learning.
Multiple-selection ComboBox for Silverlight
This article directly modifies ComboBox and replaces itemspresenter in the original ComboBox control with listboxitem, which is simple and practical.
3. The ellipsis is displayed when the long name is displayed in the text box after the ComboBox is selected.
Seeing this title does not mean I have a solution, haha. After searching for a solution on the Internet for half a day, you can only find the corresponding solution for WPF. However, don't worry. It is suggested that the texttriming attribute added in Silverlight 4 can be processed as in WPF.