I'd like to turn of the context menu when the editor is not in edit mode. Any ideas what's wrong. Also, does anyone have any experience with templating XamDataGrid? I didn't have any luck with the ControlHostEditor.
<igDP:Field Name="PartNumber" Label="Part"> <igDP:Field.Settings> <igDP:FieldSettings> <igDP:FieldSettings.EditorStyle> <Style TargetType="igEditors:XamTextEditor"> <Setter Property="ContextMenu"> <Setter.Value> <ContextMenu ItemsSource="{Binding DataItem.PartNumbers}"> <ContextMenu.ItemContainerStyle> <Style TargetType="MenuItem"> <EventSetter Event="Click" Handler="menPartNumber_Click"/> </Style> </ContextMenu.ItemContainerStyle> <ContextMenu.Style> <Style TargetType="ContextMenu" BasedOn="{StaticResource {x:Type ContextMenu}}"> <Style.Triggers> <DataTrigger Binding="{Binding IsInEditMode, RelativeSource={RelativeSource AncestorType={x:Type igEditors:XamTextEditor}}}" Value="False"> <Setter Property="Visibility" Value="Hidden"/> </DataTrigger> </Style.Triggers> </Style> </ContextMenu.Style> </ContextMenu> </Setter.Value> </Setter> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings></igDP:Field>
Hello Darryl,
I am glad to hear this worked out for you. Thank you for your feedback.
Please let me know if you need any further assistance or clarification on the matter.
Modified the EditTemplate. Less painful than I thought.