Hello Eli,
Thank you for writing.
You can modify the image of the
RadComboBox arrow button in the following fashion. Create a new image-bearing element (called an
ImagePrimitive), and add it to the ArrowButton in the
RadComboBox.
Please refer to the code below. Modify the path to the image being loaded in the
ImagePrimitive to point to your own image. The border primitive which draws a border around the element it encloses, is hidden. Also, you may have to adjust the value of the
PositionOffset property of the
ImagePrimitive in order to position it as you would like. You can make fine modifications to the appearance and layout of the controls at runtime using the
RadControlSpyForm.
//create the image child |
RadComboBoxElement comboboxElement = radComboBox1.RootElement.Children[0] as RadComboBoxElement; |
ImagePrimitive ip = new ImagePrimitive(); |
ip.Image = Image.FromFile("C:\\b.bmp"); |
//hide the border |
((RadArrowButtonElement)comboboxElement.Children[2].Children[1]).Children[1].Visibility = Telerik.WinControls.ElementVisibility.Collapsed; |
|
//add the image child |
((RadArrowButtonElement)comboboxElement.Children[2].Children[1]).Children.Add(ip); |
|
In response to your second question - currently,
RadComboBox does not support showing the image of the selected item. This is functionality that has been requested by other customers too, and we will consider adding it in future versions of our product.
I hope this helps. If you have any additional questions, please contact me.
All the best,
Kiril
the Telerik team