One cannot set the SvgImage of the RadListDataItems.
Additionally, when ShowImageInEditorArea is true the SvgImage must be displayed in the editor area.
As a workaround I can suggest storing the RadSvgImage in the Tag property of the RadListDataItems:
for (int i = 1; i <= 3; i++)
{
RadListDataItem item = new RadListDataItem(i.ToString());
item.Tag = RadSvgImage.FromFile("1.svg");
this.radDropDownList1.Items.Add(item);
}
private void radDropDownList1_VisualListItemFormatting(object sender, VisualItemFormattingEventArgs args)
{
args.VisualItem.SvgImage = (RadSvgImage)args.VisualItem.Data.Tag;
}
private void RadDropDownList1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
{
if (this.radDropDownList1.SelectedItem != null)
{
this.radDropDownList1.DropDownListElement.EditableElement.SvgImage = (RadSvgImage)this.radDropDownList1.SelectedItem.Tag;
}
else
{
this.radDropDownList1.DropDownListElement.EditableElement.SvgImage = null;
}
}