Alias Column Name Issue

930
2
04-16-2012 07:52 AM
CodyScott
Occasional Contributor
Hi,

I am having some troubles with using and aquiring Alias names in ArcGIS explorer and am wondering if anyone else has had an issue similar.

No matter what I do, I cannot seem to pull my the correct alias name from the column field. It only pulls the default name.

Ex.

Normal: Stringthat
Alias: Stringthatislongerthen10

I have tried looping through both rowcollections of values and trying to get it that way, as well as looping through all the columns and trying to get them that way.
Each time only returns the normal(default) field name, not the alias field name.

Interestingly, when i click a feature on the map, the popup text displays the fields with the Alias names intact.

Does anyone have suggestions or has anyone encounter this similar issue?

Thanks,

I am using layer Package Files
0 Kudos
2 Replies
DustinDunnill
Occasional Contributor
Hey Cody,

I noticed that with the useful "View Attribute Table" add in you created, it will pull the original field names.

[ATTACH=CONFIG]13599[/ATTACH]


  But when I use the clickable popup tool in Explorer, my Aliases are intact.  What I can't figure out though is why the popup is titled and subtitled with the last field name always.

[ATTACH=CONFIG]13600[/ATTACH]



I'm assuming it is just the way Explorer is written.  I have tried moving the field placement up and down in ArcMap before exporting to layer package but to no avail.  It will always title and subtitle the popup as the last original field name.
0 Kudos
EdanCain
New Contributor II
Cody,
are you getting the column names like this?
DataSourceProperties featureLayerDataSourceProps = new DataSourceProperties(@"C:\....gdb", "myFeatureLayer");

FeatureLayer featlayer = new FeatureLayer(featureLayerDataSourceProps);
featlayer.Connect();

//Alias Names
ReadOnlyCollection<string> columnAliasNames = featlayer.Table.Columns.GetColumnAliasNames();
//Names
ReadOnlyCollection<string> columnNames = featlayer.Table.Columns.GetColumnNames();

I read your's and Dustin's post so did a quick check with the next version of Explorer. I am getting expected results.

Couple of pointers though. I had a feature class as a published service in ArcGIS Server. Within ArcMap bringing in the layer directly from the database (not service) I could locally change the alias names and these persisted (saving map) when shutting ArcMap down and restarting. It did not have an effect on consuming it elsewhere directly from the GDB. Stopped the service, and within ArcCatalog changed the aliases, ok-ed them, and these were persisted within Explorer when I ran it after the changes.

Dustin, right click the layer within Explorer and go to properties. You can specify the field name that corresponds to the Popup Title value.

I had initially thought perhaps we had an error by reporting back the Field Name for both instances of Name and Alias, but that is not the case when I looked at the code.

Hope the post helps.
Edan
0 Kudos