Checkbox within MenuItem

Feb 21, 2011 at 4:54 AM
Hi All,

I'm trying to create a checkbox within a menu item, however no luck so far. I have my menu item:

<Fluent:MenuItem Header="Projects" Icon="images/excel_icon_32x32.gif" Click="ProjectsReport_Click">

If I change to:

<Fluent:MenuItem Header="Projects" Icon="images/excel_icon_32x32.gif" Click="ProjectsReport_Click">
<CheckBox ....>
</Fluent:MenuItem>

Then the MenuItem itself wont fire the click event anymore.

Is there any way to achieve this?

Best Regards,

Martin.

 

Feb 21, 2011 at 9:49 PM

Do you mean you want a check to appear to the left of the menu item when it is clicked?  You should use the IsCheckable and IsChecked properties of Fluent:MenuItem.  e.g.

<Fluent:MenuItem Header="Iteme" IsCheckable="True" IsChecked="True"/>

Feb 22, 2011 at 4:32 AM

My mistake, they should work independent.

The checkbox is to toggle an include all option in a report.

Best Regards.

Feb 22, 2011 at 8:19 PM

MenuItems are just a single row control and can't contain any other controls apart from more menu items (in a drop-down menu).  If you can post a screenshot of what you want this to look like, that would help.

Feb 23, 2011 at 8:27 PM

Hi JK,

It is a bit difficult to post a screenshot, since im unable to create the bahvious, i'd have to do something in paint, i'll try to explain a little more.

What I try to do is have a composite menuItem, the left part being the normal button that works as <Fluent:MenuItem, the right part, i'd like to have a checkbox. The reason for this all is my button generates a report in excel, the checkbox determines which records are included in the report. I could also save this with a wpf window, but it would be nicer to do it in the button.

Thanks.