dear Readers,
good afternoon. I have successfully loaded graphics from SQL Server geometry objects using certain query conditions and associated them with certain colors based on their attribute values.
When user selects them from the grid (not esri feature grid - this app was begun at esri API 1.x), the selected row is associated with the graphic in the collection using an ID and it is flashed for a few seconds using utils.flash. to make it convenient on the user, the 1st vertex is highlighted with a pushphin. all these work great.
PROBLEM:
the users want to highlight the selected graphic in a different color - since cyan is not used in the coloring scheme for displaying attribute information, and since majority of the users come from an ArcMap background, i thought it might be appropriate to assign it to cyan.
so i copied the selected graphic into another graphic object and tried to add it to ANOTHER LAYER and the application is complaining that:
Specified argument was out of the range of valid values. Parameter name: Graphic is already associated with another layer.
@ esri.arcgis.client.graphicslayer.addgraphic(graphic g).
i have attached a pdf of the error message screen capture. i did a exc.ToString() and got all the info I could.
i do not wnat to complicate the app by adding the Nth dictionary to keep track of the existing color and the ID - clearing it etc. if it comes to that, i will do it. i was wondering whether there was another simpler way of doing it.
thanks for your help.
regards
Ravi.