Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1830
XamTextEditor Style
posted

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>