Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Arcmap I can render a layer with same symbolgy applied to different fields by way of re-importing the .lyr file and choosing a Value Field. How can I replicate this functionality in ArcObjects?

share|improve this question

Given an IFeatureLayer, "theLayer", one would cast to a IGeoFeatureLayer, then get its IFeatureRenderer and cast that to a IClassBreaksRenderer. Then it is a simple matter to set the IClassBreaksRenderer's Field to the field to be rendered.

IGeoFeatureLayer lyr = theLayer as IGeoFeatureLayer;fixed
IFeatureRenderer ifr = lyr.Renderer;
IClassBreaksRenderer cbr = ifr as IClassBreaksRenderer;
cbr.Field = "someFieldName";
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.