Select to view content in your preferred language

Layer Attributes OnClick - C#

2129
1
11-16-2011 01:00 PM
VojtěchMachoň
New Contributor
Hi, Is there any sample, or some code example, how to obtain attributes data from selected layer (using TrackPoint) programatically in C# .Net ??

Thanks, Voitii
0 Kudos
1 Reply
SarahGreenlaw
Regular Contributor
Hi Voitti!

YES! See this sample code (I used the C#): 
http://help.arcgis.com/en/arcgisexplorer/1700/sdk/conceptualhelp/index.html#/Layer_Attributes/000200...

You will need to download Visual Studio C# Express from here:
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-csharp-express

Then, if you are a new user to Visual Studio, like I am, then watch the videos on this blog post to see how to deploy the script:
http://blogs.esri.com/Info/blogs/arcgisexplorerblog/archive/2010/10/12/customizing-arcgis-explorer-d...

NOTE that this works for FILE GEODATABASE FEATURE CLASSSES, and NOT layer files.  What I did was have a set of layer files in my map for viewing, and then another folder within the TOC called "Query-able layers" and put the feature classes in there. 

FYI - This also works well with the Query Builder (part of the basic build) as users can first see the associated attribute table before they write a query.  It also gives them the ability to view the results of the query in tabular format! Something that was conspicuously missing from build 1750, though earlier versions (900) did yeild a tabular list of features when a query was ran.  Not sure what you are using the table viewer for, but it sure helped me with queries. 

Cheers! & Merry Christmas!

Sarah
0 Kudos