I'm currently converting over a row of standard Silverlight Buttons at the bottom of our panels, to become a RadMenu (with RadMenuItem's for buttons). I'm using v2011.1.419.1040 of the controls.
Using the Silverlight standard built in Button I was able (rightly or wrongly) to use a binding for IsEnabled so that the "View Details" button would only be enabled when a RadGridView had 1 or more selected items.
However, when I try this using RadMenuItem it works initially disabled (nothing selected), but once a Selection in the GridView has been made then unselected (eg. using Ctrl key) the RadMenuItem stays enabled forever.
Example:-
<
telerik:RadGridView x:Name="RadGridView1" Grid.Row="0" Loaded="RadGridView_Loaded" AutoGenerateColumns="True" />
<
Button Content="View Detail" Grid.Row="1" IsEnabled="{Binding ElementName=RadGridView1,Path=SelectedItems.Count}" />
Whereas the following does not operate in the same way.
<telerik:RadMenu ClickToOpen="True" Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="2">
<telerik:RadMenuItem Header="View Detail" IsEnabled="{Binding ElementName=RadGridView1,Path=SelectedItems.Count}" />
</telerik:RadMenu>
What should be my method for achieving this with RadMenuItem? NB. I've tried hooking up to the SelectionChanged event of the RadGridView to check for SelectedItems.Count and Enable/Disable the button as necessary, but I've found some circumstances where the deselection occurs and the SelectionChanged event does not get fired.
How can I guarantee that my "View Detail" RadMenuItem cannot be clicked unless there are Selected Items? I'm hoping for a declarative Binding solution rather than having to put lines of checking code in every RadMenu click event to see if it's been clicked when nothing is currently selected in the RadGridView.....
Regards,
Rupert Henson.
Innovation Group.