Any reason why this won't work? The error complains that the ContextMenu cannot be assigned to something of type Object.
Thanks,
<igDP:XamDataGrid.Resources> <Style TargetType="{x:Type igDP:LabelPresenter}" x:Key="HeaderContextMenu"> <Setter Property="ContextMenu"> <Setter.Value> <ContextMenu> <ContextMenu.Items> <ComboBoxItem Content="Edit Layout" /> </ContextMenu.Items> </ContextMenu> </Setter.Value> </Setter> </Style> </igDP:XamDataGrid.Resources>
thanks, however why does the combo box item looks a bit funny? I assume it has picked up some of my header styling (which actually was just taken from the generic theme pack). how can i override this? the following doesn't do anything..
<igDP:XamDataGrid.Resources> <ContextMenu x:Key="cm"> <ContextMenu.Resources> <Style TargetType="{x:Type ComboBoxItem}" BasedOn="{StaticResource {x:Type ComboBoxItem}}"> </Style> </ContextMenu.Resources> <ComboBoxItem Content="Edit Layout" /> </ContextMenu> <Style TargetType="{x:Type igDP:LabelPresenter}" BasedOn="{StaticResource {x:Type igDP:LabelPresenter}}"> <Setter Property="ContextMenu" Value="{StaticResource cm}"/> </Style> </igDP:XamDataGrid.Resources>
Thanks
Hello,
It seems that the ContextMenu property cannot be assigned with a style's setter in this way. What you can use is :
<ContextMenu x:Key="cm"> <ComboBoxItem Content="Edit Layout" /> </ContextMenu> <Style TargetType="{x:Type igDP:LabelPresenter}"> <Setter Property="ContextMenu" Value="{StaticResource cm}"/> </Style>