<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Enable/Disable Edit on features in FeatureListBox in ArcGIS for Windows Mobile Questions</title>
    <link>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/enable-disable-edit-on-features-in-featurelistbox/m-p/536113#M2239</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a requirement to allow Edit and Delete of features in ArcGIS for Windows Mobile 10.1.1 based on certain attributes of selected/identified feature. E.g. if user selected a "pole" that has status set to "Survey Pending", then only surveyor should be able to edit its attributes otherwise it should be read-only. I cannot separate the data into two service layers based on Status making one editable and other read-only in Mobile for the reasons beyond my control.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From my understanding of ArcGIS for Windows Mobile, I am trying to implement FeatureListBox.CreatingFeatureListBoxMenuItems event. However, in the event handler I cannot find a way to replace existing CanExecute event on the menu command with my own CanExecute event. Does anyone know how to do it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g code below&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
protected override void OnOwnerInitialized()
{
&amp;nbsp; //...
&amp;nbsp; FeatureListBox.CreatingFeatureListBoxMenuItems += new EventHandler&amp;lt;CreatingFeatureListBoxMenuItemsEventArgs&amp;gt;
&amp;nbsp;&amp;nbsp; (FeatureListBox_CreatingFeatureListBoxMenuItems);
&amp;nbsp; //...
}


private void FeatureListBox_CreatingFeatureListBoxMenuItems(object sender, CreatingFeatureListBoxMenuItemsEventArgs e)
{
&amp;nbsp; //...
&amp;nbsp; foreach (MenuItem currMenu in e.FeatureListBox.MenuItems)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // replace currMenu.Command.CanExecute ...
&amp;nbsp; }
&amp;nbsp; //...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Vish&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:35:53 GMT</pubDate>
    <dc:creator>VishApte</dc:creator>
    <dc:date>2021-12-12T16:35:53Z</dc:date>
    <item>
      <title>Enable/Disable Edit on features in FeatureListBox</title>
      <link>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/enable-disable-edit-on-features-in-featurelistbox/m-p/536113#M2239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a requirement to allow Edit and Delete of features in ArcGIS for Windows Mobile 10.1.1 based on certain attributes of selected/identified feature. E.g. if user selected a "pole" that has status set to "Survey Pending", then only surveyor should be able to edit its attributes otherwise it should be read-only. I cannot separate the data into two service layers based on Status making one editable and other read-only in Mobile for the reasons beyond my control.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From my understanding of ArcGIS for Windows Mobile, I am trying to implement FeatureListBox.CreatingFeatureListBoxMenuItems event. However, in the event handler I cannot find a way to replace existing CanExecute event on the menu command with my own CanExecute event. Does anyone know how to do it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g code below&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
protected override void OnOwnerInitialized()
{
&amp;nbsp; //...
&amp;nbsp; FeatureListBox.CreatingFeatureListBoxMenuItems += new EventHandler&amp;lt;CreatingFeatureListBoxMenuItemsEventArgs&amp;gt;
&amp;nbsp;&amp;nbsp; (FeatureListBox_CreatingFeatureListBoxMenuItems);
&amp;nbsp; //...
}


private void FeatureListBox_CreatingFeatureListBoxMenuItems(object sender, CreatingFeatureListBoxMenuItemsEventArgs e)
{
&amp;nbsp; //...
&amp;nbsp; foreach (MenuItem currMenu in e.FeatureListBox.MenuItems)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // replace currMenu.Command.CanExecute ...
&amp;nbsp; }
&amp;nbsp; //...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Vish&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:35:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-for-windows-mobile-questions/enable-disable-edit-on-features-in-featurelistbox/m-p/536113#M2239</guid>
      <dc:creator>VishApte</dc:creator>
      <dc:date>2021-12-12T16:35:53Z</dc:date>
    </item>
  </channel>
</rss>

