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

RadComboBox selected item not showing

3 Answers 166 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Morgan
Top achievements
Rank 1
Morgan asked on 15 Mar 2012, 03:24 PM
I have a radcombobox in which the items are set in xaml. Each item is a stackpanel with two colored rectangles to simulate a color pallet.

When an item is selected, it is not displayed in the radcombobox. I have tried this with Silverlight's default combobox, and it works as expected.
 
Do Silverlight's ComboBox control and the RadCombobox typically behave differently in this way? What could be causing the different behaviors?

<telerik:RadComboBox HorizontalAlignment="Left" Margin="28,344,0,0" Name="radComboBox1" VerticalAlignment="Top" Width="250">
            <telerik:RadComboBoxItem >
                <StackPanel Orientation="Horizontal">
                    <Rectangle Fill="Red" Width="111" Height="20" />
                    <Rectangle Fill="Blue" Width="111"  Height="20"/>
                </StackPanel>
            </telerik:RadComboBoxItem>
            <telerik:RadComboBoxItem >
                <StackPanel Orientation="Horizontal">
                    <Rectangle Fill="Green" Width="111" Height="20" />
                    <Rectangle Fill="Red" Width="111"  Height="20"/>
                </StackPanel>
            </telerik:RadComboBoxItem>
        </telerik:RadComboBox>

3 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 19 Mar 2012, 12:50 PM
Hi Morgan,

To display the selected item we are using SelectionBox. So the box doesn't know how to display the rectangles and you need to set SelectionBoxTemplate. How to achieve that you can see here.

Regards,
Author nickname
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Matt
Top achievements
Rank 1
answered on 04 May 2018, 06:33 PM
Please remove this link on how to achieve this as the link is broken.
0
Martin Ivanov
Telerik team
answered on 08 May 2018, 10:12 AM
Hello Matt,

Thank you for bringing this to my attention. I fixed the link in the Georgi's post and I am also posting it here in my reply: https://docs.telerik.com/devtools/silverlight/controls/radcombobox/features/populating-with-data-selectionbox

Regards,
Martin Ivanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ComboBox
Asked by
Morgan
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Matt
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or