Update WHERE clause in Feature Layer

540
3
Jump to solution
02-07-2013 09:23 AM
JayKappy
Occasional Contributor
I am referencing this URL
http://resources.arcgis.com/en/help/silverlight-api/concepts/index.html#/Feature_layers/016600000015...

I can see how the Feature layer is created and the WHERE clause is established....
Anyone have any examples on how to update this WHERE clause via VB or c++, preferably VB

I am currently am using GraphicsLayer and heard that I can use the ProxyURL property but want to figure both ways out.

I assume the QueryTask is the same for a GraphicsLayer as it is for a FeatureLayer?  But how do I update the WHERE Clause in the FeatureLayer?

Any examples would be very helpful....thanks
0 Kudos
1 Solution

Accepted Solutions
JayKappy
Occasional Contributor
scrapped the Feature Layer and went with the Graphics Layer and a defined Long Term Token on the QueryTask of the Graphics Layer

scrapped the proxy page and went with long term token that is defined on the QueryTask

Dim queryTask2 As New QueryTask("https://.org/arcgis/rest/services/Grove/MapServer/7")
AddHandler queryTask2.ExecuteCompleted, AddressOf QueryTask_ExecuteCompletedSearch
AddHandler queryTask2.Failed, AddressOf QueryTask_FailedSearch

Dim query2 As New ESRI.ArcGIS.Client.Tasks.Query()
query2.OutFields.AddRange(New String() {"PID"})
query2.ReturnGeometry = False
query2.Where = "1=1"

' Specify the Token
queryTask2.Token = â??Generated Token for your URLâ??

queryTask2.ExecuteAsync(query2, "initial")

View solution in original post

0 Kudos
3 Replies
ChrisBradberry
Occasional Contributor
You can set the where clause in the xaml.  see this example http://resources.arcgis.com/en/help/silverlight-api/samples/start.htm#FeatureLayerFiltering

Chris
0 Kudos
JayKappy
Occasional Contributor
Thanks you for your responce....
What I am trying to get at is the feature layer is dynamic...in that I mean....when the user searches for another property or clicks on the screen I am running a buffer and spatial query. ...from this query I get another set of features to display in the feature layer....just need to know how to take this query result and update the WHERE clause set in xaml....
0 Kudos
JayKappy
Occasional Contributor
scrapped the Feature Layer and went with the Graphics Layer and a defined Long Term Token on the QueryTask of the Graphics Layer

scrapped the proxy page and went with long term token that is defined on the QueryTask

Dim queryTask2 As New QueryTask("https://.org/arcgis/rest/services/Grove/MapServer/7")
AddHandler queryTask2.ExecuteCompleted, AddressOf QueryTask_ExecuteCompletedSearch
AddHandler queryTask2.Failed, AddressOf QueryTask_FailedSearch

Dim query2 As New ESRI.ArcGIS.Client.Tasks.Query()
query2.OutFields.AddRange(New String() {"PID"})
query2.ReturnGeometry = False
query2.Where = "1=1"

' Specify the Token
queryTask2.Token = â??Generated Token for your URLâ??

queryTask2.ExecuteAsync(query2, "initial")
0 Kudos