How to set color to shape in polygon dynamically from Code Behind?

675
2
02-18-2014 05:09 AM
Labels (1)
ArthurFofanov
New Contributor
Hello, I have a shapefile which contains a polygon with multiple shapes, (different regions in NY state). Is there a way to set dynamic colors to different regions (shapes)?
0 Kudos
2 Replies
BKuiper
Occasional Contributor III
You can specify a renderer for your layer. A possible way is to use the UniqueValueRenderer and specify a color based on an attribute within the layer, for example the region column/field (if you something like that)
0 Kudos
ArthurFofanov
New Contributor
You can specify a renderer for your layer. A possible way is to use the UniqueValueRenderer and specify a color based on an attribute within the layer, for example the region column/field (if you something like that)



Thanks a lot!
It was quite easy and intuitive (kidding!) :), just instead of SimpleRenderer for Graphics object I had to use UniqueValueRenderer, which binds Attribute from shape file to SimpleFillSymbol. Really, ESRI?! Anyways, whatever it takes, as soon as it works.
0 Kudos