﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - ClientUI - UXGridView: Visability UXMenuItem</title><link>http://www.intersoftsolutions.com/Community/ClientUI/UXGridView-Visability-UXMenuItem/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>UXGridView: Visability UXMenuItem</title><link>http://www.intersoftsolutions.com/Community/ClientUI/UXGridView-Visability-UXMenuItem/</link><pubDate>Thu, 03 Nov 2011 04:53:21 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><category>uxgridview</category><description>&lt;p&gt;Hello Michael,&lt;/p&gt;&lt;p&gt;In order to achieve your scenario, it needs big efforts for it.&lt;br /&gt;First, you need to handle MouseDown event on UXGrid, then set validation if it is Row action or not to return the correct contextmenu by using execute command. To handle its visibility at first load, you also need to set &lt;b&gt;CommandCannotExecute="Collapsed"&lt;/b&gt;.&lt;br /&gt;I also attached how to use it. To run the sample simply use our MVVM Data Aplication (DevForce).&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>UXGridView: Visability UXMenuItem</title><link>http://www.intersoftsolutions.com/Community/ClientUI/UXGridView-Visability-UXMenuItem/</link><pubDate>Wed, 02 Nov 2011 04:16:49 GMT</pubDate><dc:creator>mg@hsig.ch</dc:creator><category>uxgridview</category><description>&lt;p&gt;Hi Handy&lt;/p&gt;
&lt;p&gt;As you've described in this &lt;a href="http://www.intersoftpt.com/Community/ClientUI/ClientUI-MVVM-Data-Application-template-reusable-code-Grouping-CopyPaste/" target="_blank"&gt;thread&lt;/a&gt;. I've saved the style in UXGridViewStyle.xaml (see attached File).&lt;/p&gt;
&lt;p&gt;In the UXGridViewStyle.xaml under UXGridViewStyle (line 999) you will find the following line of code:&lt;/p&gt;&lt;pre&gt;&amp;lt;Intersoft:UXGridViewContextMenu x:Name="ContextMenu" Style="{StaticResource UXGridViewContextMenuStyle}"/&amp;gt;&lt;/pre&gt;

&lt;p&gt;In UXGridView I use:&lt;/p&gt;&lt;pre&gt;Style="{StaticResource UXGridViewStyle}"&lt;/pre&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Michael&lt;/p&gt;</description></item><item><title>UXGridView: Visability UXMenuItem</title><link>http://www.intersoftsolutions.com/Community/ClientUI/UXGridView-Visability-UXMenuItem/</link><pubDate>Mon, 31 Oct 2011 06:31:35 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><category>uxgridview</category><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;Can I know how you apply the style in UXGridView? As far I know, &lt;span style="color: rgb(63, 63, 63); font-family: 'segoe ui', arial, verdana, tahoma; font-size: 12px; line-height: 18px; background-color: rgb(255, 255, 255); "&gt;&amp;nbsp;UXGridView have not provided style for specific context menu. It can be done, but too much efforts. Our developer team would like to enhance this in the future.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Handy&lt;/span&gt;&lt;/p&gt;</description></item><item><title>UXGridView: Visability UXMenuItem</title><link>http://www.intersoftsolutions.com/Community/ClientUI/UXGridView-Visability-UXMenuItem/</link><pubDate>Fri, 28 Oct 2011 04:47:14 GMT</pubDate><dc:creator>mg@hsig.ch</dc:creator><category>uxgridview</category><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I have added a new UXMenuItem to the UXGridViewContextMenuStyle in blend (see DuplicateRowCommand).&lt;/p&gt;&lt;pre&gt;&amp;lt;Style x:Key="UXGridViewContextMenuStyle" TargetType="Intersoft:UXGridViewContextMenu"&amp;gt;
    &amp;lt;Setter Property="Template"&amp;gt;
        &amp;lt;Setter.Value&amp;gt;
            &amp;lt;ControlTemplate TargetType="Intersoft:UXGridViewContextMenu"&amp;gt;
                &amp;lt;Grid x:Name="RootElement"&amp;gt;
                    &amp;lt;Intersoft:UXContextMenu x:Name="ContextMenuElement" IsOpen="{TemplateBinding IsOpen}"&amp;gt;
                        &amp;lt;Intersoft:UXMenuItem Command="local:UXGridViewContextMenuCommands.SortAscending" Header="{Binding ContextMenu_SortAscending, Source={StaticResource GridViewResource}}" Icon="/QMS;component/Assets/Images/16/sort_az_ascending2.png"/&amp;gt;
                        &amp;lt;Intersoft:UXMenuItem Command="local:UXGridViewContextMenuCommands.SortDescending" Header="{Binding ContextMenu_SortDescending, Source={StaticResource GridViewResource}}" Icon="/QMS;component/Assets/Images/16/sort_az_descending.png"/&amp;gt;
                        &amp;lt;Intersoft:UXSeparator x:Name="GroupSeparator"/&amp;gt;
                        &amp;lt;Intersoft:UXMenuItem Command="local:UXGridViewContextMenuCommands.GroupByBox" Header="{Binding ContextMenu_GroupByBox, Source={StaticResource GridViewResource}}" IsCheckable="True"/&amp;gt;
                        &amp;lt;Intersoft:UXMenuItem Command="local:UXGridViewContextMenuCommands.Group" Header="{Binding ContextMenu_Group, Source={StaticResource GridViewResource}}"/&amp;gt;
                        &amp;lt;Intersoft:UXMenuItem Command="local:UXGridViewContextMenuCommands.Ungroup" Header="{Binding ContextMenu_Ungroup, Source={StaticResource GridViewResource}}"/&amp;gt;
                        &amp;lt;Intersoft:UXSeparator x:Name="EditingSeparator"/&amp;gt;
                        &amp;lt;Intersoft:UXMenuItem x:Name="CopyRowItem" Command="local:UXGridViewContextMenuCommands.CopyRow" Header="{Binding ContextMenu_CopyRow, Source={StaticResource GridViewResource}}" Icon="/QMS;component/Assets/Images/16/clipboard_add.png"/&amp;gt;
                        &amp;lt;Intersoft:UXMenuItem Command="local:UXGridViewContextMenuCommands.Edit" Header="{Binding ContextMenu_Edit, Source={StaticResource GridViewResource}}" Icon="/QMS;component/Assets/Images/16/pencil.png"/&amp;gt;
                        &amp;lt;Intersoft:UXMenuItem Command="local:UXGridViewContextMenuCommands.Delete" Header="{Binding ContextMenu_Delete, Source={StaticResource GridViewResource}}" Icon="/QMS;component/Assets/Images/16/delete.png"/&amp;gt;
                        &amp;lt;Intersoft:UXMenuItem Command="local:UXGridViewContextMenuCommands.Update" Header="{Binding ContextMenu_Update, Source={StaticResource GridViewResource}}" Icon="/QMS;component/Assets/Images/16/check.png"/&amp;gt;
                        &amp;lt;Intersoft:UXMenuItem Command="local:UXGridViewContextMenuCommands.Cancel" Header="{Binding ContextMenu_Cancel, Source={StaticResource GridViewResource}}" Icon="/QMS;component/Assets/Images/16/delete.png"/&amp;gt;
                        &amp;lt;Intersoft:UXMenuItem Visibility="{Binding ElementName=CopyRowItem,Path=Visibility}" Command="{Binding DuplicateRowCommand}" CommandParameter="{Binding SelectedItem}" Header="Duplizieren" Icon="/QMS;component/Assets/Images/16/element_copy.png"/&amp;gt;
                        &amp;lt;Intersoft:UXSeparator x:Name="BatchUpdateSeparator"/&amp;gt;
                        &amp;lt;Intersoft:UXMenuItem Command="local:UXGridViewContextMenuCommands.SaveChanges" Header="{Binding ContextMenu_SaveChanges, Source={StaticResource GridViewResource}}" Icon="/Intersoft.Client.UI.Data;component/Resources/savechanges.png"/&amp;gt;
                        &amp;lt;Intersoft:UXMenuItem Command="local:UXGridViewContextMenuCommands.RejectChanges" Header="{Binding ContextMenu_RejectChanges, Source={StaticResource GridViewResource}}" Icon="/Intersoft.Client.UI.Data;component/Resources/rejectchanges.png"/&amp;gt;
                    &amp;lt;/Intersoft:UXContextMenu&amp;gt;
                &amp;lt;/Grid&amp;gt;
            &amp;lt;/ControlTemplate&amp;gt;
        &amp;lt;/Setter.Value&amp;gt;
    &amp;lt;/Setter&amp;gt;
&amp;lt;/Style&amp;gt;&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;It works great. I have only the problem that the menu item is always visible (see attached picture).&lt;/p&gt;
&lt;p&gt;A simple solution would be a visability-binding to CopyRow. But I am not so happy about this...&lt;/p&gt;&lt;pre&gt;&amp;lt;Intersoft:UXMenuItem x:Name="CopyRowItem" Command="local:UXGridViewContextMenuCommands.CopyRow" Header="{Binding ContextMenu_CopyRow, Source={StaticResource GridViewResource}}" Icon="/QMS;component/Assets/Images/16/clipboard_add.png"/&amp;gt;
&amp;lt;Intersoft:UXMenuItem Visibility="{Binding ElementName=CopyRowItem,Path=Visibility}" Command="{Binding DuplicateRowCommand}" CommandParameter="{Binding SelectedItem}" Header="Duplizieren" Icon="/QMS;component/Assets/Images/16/element_copy.png"/&amp;gt;&lt;/pre&gt;

&lt;p&gt;Can I find out which context menu (row or header) appears to control the visibility of items?&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Michael&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item></channel></rss>