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
370
xamDataGrid contextmenu
posted

I retemplated XamMenuItem but i am getting some wierd behavior. There is a XamComboEditor on the context menu and whenever I click on this control, the contextmenu closes. I set the property "StaysOpenOnClick to true on the context menu, but it wont work.

I don't know whether I am missing anything. Below is the xaml style. I could attach image to this post

 <Style x:Key="PurpleMenuItemStyle" TargetType="ig:XamMenuItem">
                                <Setter Property="Background" Value="Transparent"/>
                                <Setter Property="IsTabStop" Value="True"/>
                                <Setter Property="IsEnabled" Value="True"/>
                                <Setter Property="ItemsPanel">
                                    <Setter.Value>
                                        <ItemsPanelTemplate>
                                            <StackPanel Orientation="Vertical"/>
                                        </ItemsPanelTemplate>
                                    </Setter.Value>
                                </Setter>
 
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="ig:XamMenuItem">
                                            <Grid Background="Gray">
                                                <Grid Margin="5,25,5,5" Background="White">
                                                   
                                                    <!-- MenuItemPresenter - presentes the content of the menu item. -->
                                                    <ContentControl x:Name="MenuItemPresenter" 
                                                HorizontalContentAlignment="Stretch"
                                                Visibility="Visible"
                                                FontFamily="{TemplateBinding FontFamily}"
                                                FontSize="{TemplateBinding FontSize}"
                                                FontStretch="{TemplateBinding FontStretch}"
                                                Foreground="{TemplateBinding Foreground}" 
                                                Opacity="1"
                                                Margin="5">
 <Grid >
                                                                    <Grid.ColumnDefinitions>
                                                                        <ColumnDefinition x:Name="LabelColumn" Width="Auto" />
                                                                        <ColumnDefinition x:Name="DropdownColumn" Width="Auto"/>
                                                                    </Grid.ColumnDefinitions>
                                                                    <Grid.RowDefinitions>
                                                                        <RowDefinition Height="Auto" />
                                                                        <RowDefinition Height="Auto" />
                                                                        <RowDefinition Height="Auto" />
                                                                        <RowDefinition Height="Auto" />
                                                                    </Grid.RowDefinitions>
                                                                
                                                               
                                                                <!-- Label presenter-->
                                                                <TextBlock Grid.Column="0" Grid.Row="0" HorizontalAlignment="Right" Text="Stream" />
                                                            <TextBlock Grid.Column="0" Grid.Row="1"  HorizontalAlignment="Right" Text="Record" />
                                                            <TextBlock Grid.Column="0" Grid.Row="2"  HorizontalAlignment="Right" Text="Item" />
 
                                                                <!-- DropDown presenter-->
 
                                                            <igEditors:XamComboEditor Grid.Column="1" Grid.Row="0"  Name="StremContextDP" Height="Auto" MinWidth="150" Style="{StaticResource ComancheXamComboEditorCtrl}"  HorizontalAlignment="Left"  VerticalAlignment="Stretch"  ItemsSource="{Binding StreamsList}" DisplayMemberPath="ItemName" />
                                                            <igEditors:XamComboEditor Grid.Column="1" Grid.Row="1"  Name="RecordContextDP" Height="Auto" MinWidth="150" Style="{StaticResource ComancheXamComboEditorCtrl}"  HorizontalAlignment="Left"  VerticalAlignment="Stretch"  ItemsSource="{Binding RecordList}" DisplayMemberPath="ItemName" />
                                                            <igEditors:XamComboEditor Grid.Column="1" Grid.Row="2"  Name="ItemContextDP" Height="Auto" MinWidth="150" Style="{StaticResource ComancheXamComboEditorCtrl}"  HorizontalAlignment="Left"  VerticalAlignment="Stretch"  ItemsSource="{Binding ItemList}" DisplayMemberPath="ItemName" />
                                                            <Button Content="Set All" Grid.ColumnSpan="2" Grid.Row="3" HorizontalAlignment="Right" Margin="2"/>
                                                        </Grid>
 
                                                    </ContentControl>
                                                </Grid>
 
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>