Select to view content in your preferred language

Enable/Disable Edit on features in FeatureListBox

780
0
10-21-2013 05:34 PM
VishApte
Esri Contributor
Hi all,

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.

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?

e.g code below

protected override void OnOwnerInitialized()
{
  //...
  FeatureListBox.CreatingFeatureListBoxMenuItems += new EventHandler<CreatingFeatureListBoxMenuItemsEventArgs>
   (FeatureListBox_CreatingFeatureListBoxMenuItems);
  //...
}


private void FeatureListBox_CreatingFeatureListBoxMenuItems(object sender, CreatingFeatureListBoxMenuItemsEventArgs e)
{
  //...
  foreach (MenuItem currMenu in e.FeatureListBox.MenuItems)
  {
     // replace currMenu.Command.CanExecute ...
  }
  //...      
}


Regards,
Vish
0 Kudos
0 Replies