Symbology for ArcEngine 10 app

461
2
08-16-2011 09:38 AM
KevinGooss
Occasional Contributor
I have an engine app that i am converting from 9.3 to 10.0sp1 C# VS2010.
In my old app i allowed users to change the symbology of layers using the Symbol Select sample code from esri.
The problem i have now is that users want to also define category symbology which i believe is the same as the unique renderer color ramp setup.
Is this code already written somewhere that i can just jack it?
My symbol selector only loads the esri styles for single symbol it appears.
Am i missing something?
0 Kudos
2 Replies
EdgarBejarano
Occasional Contributor
Correct, defining symbology by category is essentially the same as applying a UniqueValueRenderer in ArcObjects.  This is as opposed to defining a Single Symbol (SimpleRenderer in ArcObjects).  The below ArcObjects SDK sample code contains a VB.NET procedure or a C# method that you can call with its required parameters in order to apply a unique value renderer to a polygon feature layer.  As with all samples, you will need to make the necessary adjustments.  I suspect the sample will fall short of your specific workflow and application but it does demonstrate how to define a unique value renderer with a lot of the typical properties of that type of renderer.

How to define a [unique value] renderer for your layer
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/0001000000t8000000.ht...
0 Kudos
KevinGooss
Occasional Contributor
Thank you. That is a very helpful link.
I also found the SymbologyControlColorRamps sample that is included with the sdk install.
Both focus on polygon features only. I changed the esri sample to do away with the polygon filter but then when i apply the color ramp it will not display the layer. I'm guessing this is cause the sample code assigns a SimpleFillSymbolClass and that won't fly for points and lines.
Guess i have some reworking ahead of me to get it to work for all geometries.
thanks for the tip
0 Kudos