Goal --- Hide Attribute Fields in an attribute table
Given a feature class with an attribute table, how would attribute fields be programmatically shown/hidden?
Places already researched...
ProSnippets Editing · Esri/arcgis-pro-sdk Wiki (github.com)
ArcGIS.Desktop.Editing.Controls Namespace—ArcGIS Pro
Thank You... This worked perfectly. Nice little piece of code.
Hi All,
I have a point feature class with more than 50 fields that mainly consist of fixed values ("Yes" or "No"). I am looking for an approach to only show fields if they have a "Yes" value when I select a feature. For example, when I select a row or pick a point from the map, it only shows fields "A", "B", and "D" where they have a "Yes" value, but don't show field "C" that has a "No" value. And when I select another point, it should show its fields that have a "Yes" value which could be field "A" and "C".
Your feedback appreciated.
Gintautas,
Thank You for your reply.
Have a Good Day
Try this:
var invisibleFields = new[] { "OBJECTID", "HIDDEN_FIELD" }; var layer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(); var fields = layer.GetFieldDescriptions(); foreach (var field in fields) { field.IsVisible = !invisibleFields.Contains(field.Name); } layer.SetFieldDescriptions(fields);
Hi,
Have you tried this:
How-to-change-field-visibility-and-alias
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.