sergiy2001

IUniqueValueRenderer problems

Discussion created by sergiy2001 on Apr 12, 2011
Latest reply on Apr 15, 2011 by sergiy2001
I have some problems with code:

public override void OnClick()
{
            IMxDocument pMxDoc = (IMxDocument)m_application.Document;
            IMap pMap = pMxDoc.FocusMap;
            ILayer player = pMap.get_Layer(0);
            IUniqueValueRenderer pUVR = new UniqueValueRendererClass();
            pUVR = ((IGeoFeatureLayer)player).Renderer as IUniqueValueRenderer;
            for (int i = 0; i < pUVR.ValueCount; i++)
            {
                if (pUVR.get_Value(i) != "?????????????")
                    pUVR.AddReferenceValue(pUVR.get_Value(i), "?????????????");
            }
            IRendererPropertyPage pRPpage = new UniqueValuePropertyPageClass();
            ((IGeoFeatureLayer)player).RendererPropertyPageClassID = pRPpage.ClassID;
            pMxDoc.ActivatedView.Refresh();
            pMxDoc.CurrentContentsView.Refresh(null);
            pMxDoc.UpdateContents();
        }
this code group all unique value by AddReferenceValue method and it shows everything correctly in activeview, but not in TOC. It's still shows in TOC all my unique value and any kind of refresh and update methods doesn't help me.
Even in a layer properties - symbology correct representation. Help me please to correct TOC representation.

Attachments

Outcomes