Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 64
Registered: ‎01-14-2018
Accepted Solution

Renaming sub legendentries in GeoMedia

Dear all,

 

I am trying to rename sub legendentries by the follwing code:

 

Dictionary<string, PView.LegendEntry> innerLegE = new Dictionary<string, PView.LegendEntry>();
for (int i = 1; i <= myLegendEntry.GroupEntries.Count; i++)
{
innerLegE[i.ToString()] = myLegendEntry.GroupEntries[i] as PView.LegendEntry;


if (innerLegE[i.ToString()].Name == "1")
{
    innerLegE[i.ToString()].Name = "BM";
}
}

Actually it rename it but it doesn't change its name in the legend Pane.

 

So how can I show this change on the the legend Pane?

 

Best Regards

Khaled

Regular Contributor
Posts: 155
Registered: ‎05-25-2016

Re: Renaming sub legendentries in GeoMedia

Hi Khaled

 

The Name property is an internal data to identify the legend entry uniquely.

 

Use insteat of Name property the Title entry from the PropertySet of the LegendEntry object to change the label in the legend:

 

MyLegendEntry.PropertySet("Title").Value = "BM"

 

Best regards,

hesrah

Contributor
Posts: 64
Registered: ‎01-14-2018

Re: Renaming sub legendentries in GeoMedia

Thanks hesrah Smiley Happy ,

 

That worked with me:

innerLegE[i.ToString()].Title = "BM";

Best Regards

Khaled

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.