How to retrieve the values of a graphic?

2922
1
06-11-2015 12:13 PM
ShaningYu
Frequent Contributor

When I debug on a graphic object in my .Net project, I can see the values of the graphic in VS Watch window. However, if I type

gLayer.Graphics[0].Attributes.Values[0].ToSring()

in the Immediate Window, such an error displays:

Cannot apply indexing with [] to an expression of type 'System.Collections.Generic.ICollection<object>'

How to retrieve the values of a graphic object using .Net code?  Thanks.

0 Kudos
1 Reply
ShaningYu
Frequent Contributor

Problem solved by converting it to an array, like that:

gLayer.Graphics[0].Attributes.Values.ToArray()

Thanks for your review.

0 Kudos