Icon on DropDownMenuItem of a SplitButton

Hi,

should a DropDownMenuItem support Icons?
I guess so. at least it has a Icon property.
However it seems not to work:

                    <syncfusion:SplitButton Label="Clean Up" SmallIcon="Image/Apply_Changes_32x.png">
                        <syncfusion:DropDownMenuItem Header="Clean Up Folder" Icon="Image/Apply_Changes_32x.png"/>
                        <syncfusion:DropDownMenuItem Header="Clean Up Conversation"/>
                        <syncfusion:DropDownMenuItem Header="Clean Up Folder/SubFolder"/>
                    </syncfusion:SplitButton>

i added a Icon via SmallIcon for the Splitbutton itself and that is shown ok.
the icon on the DropDownMenuItem shows as below. Seems it is showing the word "Image" from the path instead of the icon:


thanks,

Helmut


5 Replies

ON Olety Nikhilesh Olety Nagendra Syncfusion Team March 12, 2020 08:50 AM UTC

 
Thank you for contacting Syncfusion support. 
 
The Icon property of DropDownMenuItem is an Object type, so you need to set the Image separately for the icon. 
 
Please refer the below UG. 
 
Regards, 
Nikhilesh  



HW Helmut Wahrmann March 12, 2020 11:55 AM UTC

Hi Nikhilesh,

sorry, but when using that as part of a SplitButton in the Ribbon, i have no Icon Object to set.
I have only the Icon property.

or do i something wrong?

thanks,

Helmut


ON Olety Nikhilesh Olety Nagendra Syncfusion Team March 12, 2020 12:24 PM UTC

Hi Helmut, 
 
The object type which I meant in previous update is that Icon property in DropDownMenuItem has the data type of object. You can use the below code snippet to set an icon to DropDownMenuItem. 
 
Code snippet: 
<shared:DropDownMenuItem Header="Menu Item 1">    <shared:DropDownMenuItem.Icon>      <Image Source="Images/Home.png"/>    </shared:DropDownMenuItem.Icon> </shared:DropDownMenuItem>
 
Regards, 
Nikhilesh 



HW Helmut Wahrmann March 12, 2020 03:44 PM UTC

works now.
I should have compiled the xaml before and not relying on Intellisense in the Editor telling me that this doesn't exist

thanks,

Helmut


ON Olety Nikhilesh Olety Nagendra Syncfusion Team March 13, 2020 05:43 AM UTC

Hi Helmut, 
 
We are glad that reported query has been resolved at your end, please get back to us if you have any other queries. 
 
Regards, 
Nikhilesh  


Loader.
Up arrow icon