Legend View Attributes Error

Sep 21, 2011 at 4:02 PM
Edited Sep 21, 2011 at 4:05 PM

Is anyone else getting this error? Right click on a Layer in the Legend and select View Attributes. 3 Attribute Table Editors open at the same time for the same Layer.

Same thing happens with the Properties selection. 3 Layer Properties windows open, 1 after the other.

Just checked and 3 of everything open, Attributes, Properties, Labels, etc.

Terry

Developer
Sep 21, 2011 at 5:48 PM

I'm not seeing that issue when using DemoMap.

Sep 21, 2011 at 8:32 PM

I am using the latest build controls.

Sep 22, 2011 at 12:03 AM
Edited Sep 22, 2011 at 12:04 AM

It doesn't happen to me.

Attribute table and properties are working fine, even when I selected two layers.

Sep 22, 2011 at 1:38 PM

I have the map/legend/appmanager control on a few (3) forms in the same apllication as they perform different functions. On my main form the control seems to be fine but not so on the others.  When I open the form with the second map the legend generated forms open 2 times. When I open the form with the third map, the legend generated forms open 3 times.

Multiple instances of forms are being generated for the Legend right clicks. This is sometimes followed by an error (Attribute Table Editor) which is:

DataGrifView Default Error Dialog
System.AgumentException: Column 'FID1' does not belong to table.
at System.Data.DataRow.CheckColumn(DataColumn column)
at System.Data.DataColumnPropertyDescriptor.GetValue(Object.component)
at System.Windows.Forms.DataGridView.DataGridViewDataConnection.GetValue(Int32.boundCoumnIndex,Int32 columnIndex, Int32 rowindex)

This error appears many times right after each other.

Sep 22, 2011 at 1:48 PM

Upon further inverstigation I have found that it does not matter which form with the map control is launched first. Once another form is launched with a map control on it, all map controls on all forms will generate the same number of duplicate Legend forms. I added a 4th form with a map control on it and all maps will produce 4x the legend forms once they are opened, including my initial (main) map control form.

 

Developer
Sep 23, 2011 at 7:13 PM

Most likely all three (or four) forms are handling the same event, which essentially means the code runs multiple times. Do you have all of these legend controls wired up to map1?

Sep 27, 2011 at 2:23 PM

They were all using Map1. I have changed them to Map1, Map2, and Map3 but no change.

Oct 18, 2011 at 2:31 PM

I did a little more checking on this problem. I created a new VB.Net 2010 project.

I added a form, map, and legend named Map1 and Legend1. I ran the app and added layers by dragging shapefiles onto Map1.

Everthing works fine.

Then I added another map (Map2) and legend (Legend2) to the same form. I ran the app and added layers by dragging shapefiles onto Map1.

When selecting anything in Legend1, all forms are being opened twice.

I removed the second legend and map (Map2 and Legend2) from the form and ran the app again, then added layers by dragging shapefiles onto Map1.

Everthing works fine.

I created a new form and added a map and legend to it named Map2 and Legend2.

I ran the app and added layers by dragging shapefiles onto Map1.

Everthing works fine.

Then I opened the second form with the second map and legend on it (Map2 and Legend2). I did nothing more and closed the form.

On my first form I added layers by dragging shapefiles onto Map1.

When selecting anything in Legend1, all forms are being opened twice.

I added another map and legend to Form2 named Map3 and Legend3.

I ran the app and added layers by dragging shapefiles onto Map1.

Everthing works fine.

Then I opened the second form with the second and third map and legend on it (Map2, Map3 and Legend2, Legend3). I did nothing more and closed the form.

On my first form I added layers by dragging shapefiles onto Map1.

When selecting anything in Legend1, all forms are being opened three times.

I did this with and wiithout an AppManager on Form1 with no difference.

Terry

 

Developer
Oct 19, 2011 at 2:13 AM

Can you provide a link to the sample project? I'm not sure if you are connection Map1 to Legend1 etc.

Oct 19, 2011 at 1:34 PM

In the Properties section of each map, I am setting the Legend to the corresponding Legend on the form.

Developer
Oct 19, 2011 at 11:34 PM

I took DemoMap and Added a second map and legend and was able to reproduce this bug.

Inside the Legend constructor  a new SymbologyEventManager is created. The SymbologyEventManager instantiates a FeatureLayerEventReceiver which finds a global 

FeatureLayerEventSender.Instance

and attaches a number of events.

This results in multiple dialog boxes opening when only one was intended.

Developer
Oct 19, 2011 at 11:34 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Nov 15, 2012 at 1:09 PM

Hi all,

I am experiencing the same, did you solve the problem?

Thank you

Oscar