Select to view content in your preferred language

Query result or Graphic with display field

792
2
Jump to solution
01-26-2012 02:26 PM
Matrix_Solutions_Inc_Geomatics
Regular Contributor
Hi, I was wondering if there was a way to pull the primary display field of a layer from a query task result or out of the graphic in the feature set.

I know that the IdentifyResult contains the 'value' property that has it and I was wondering if the same can be accomplished from the QueryEventArgs.

Thx.
0 Kudos
1 Solution

Accepted Solutions
Matrix_Solutions_Inc_Geomatics
Regular Contributor
I found this DisplayFieldName property in the QueryEventArgs.FeatureSet

 Private Sub QueryTask_ExecuteCompleted(ByVal sender As Object, ByVal args As ESRI.ArcGIS.Client.Tasks.QueryEventArgs)      If args.FeatureSet.Count > 0 Then             Dim Results As FeatureSet             Results = args.FeatureSet             Dim displayFieldName As String = Results.DisplayFieldName



....

View solution in original post

0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor
QueryTask does not return "displayField". You can either read this JSON string yourself: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/.... Use GetDetails(layer id) from ArcGISDynamicMapServiceLayer: http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.ArcGISDyna... or use FeatureLayer.LayerInfo.DisplayField.
0 Kudos
Matrix_Solutions_Inc_Geomatics
Regular Contributor
I found this DisplayFieldName property in the QueryEventArgs.FeatureSet

 Private Sub QueryTask_ExecuteCompleted(ByVal sender As Object, ByVal args As ESRI.ArcGIS.Client.Tasks.QueryEventArgs)      If args.FeatureSet.Count > 0 Then             Dim Results As FeatureSet             Results = args.FeatureSet             Dim displayFieldName As String = Results.DisplayFieldName



....
0 Kudos