First isn't neccesairly related to a context menu. How can bind the IsEnabled property to whether or not a selected item in a datagrid matches a criteria. The criteria being a property from the datasource called Status value being between 15 and 40. I could run a check afterwards in the VB codebehind before actually executing something from the context menu, but I would like it to be displayed as greyed out for the user. I am using RIA services and binding to a domaindatasource.
Second is something I ran accross while trying to find a solution for #1, is whether you can bind the header values in the radcontextmenu to a datasource. I was just doing this to check the binding but it comes up as an empty entry in the context menu.
Here is a snippet of what I was working with.
<
telerik:RadGridView x:Name="ProjectGrid" ItemsSource="{Binding ElementName=ProjectData,Path=Data}" DataContext="{StaticResource ProjectTemplate}">
<telerik:RadContextMenu.ContextMenu>
<telerik:RadContextMenu DataContext="{Binding ElementName=ProjectGrid,Path=SelectedItem}">
<telerik:RadContextMenu.Items>
<telerik:RadMenuItem Header="Collect $200 and Pass Go" IsEnabled=" "/>
<telerik:RadMenuItem Header="{Binding ElementName=ProjectGrid,Path=SelectedItem.First}"/>
<telerik:RadMenuItem Header="{Binding Status}"/>
</telerik:RadContextMenu.Items>
</telerik:RadContextMenu>
</telerik:RadContextMenu.ContextMenu>
</telerik:RadGridView>