change WHERE clause in <esri:FeatureLayer  and zoom to

2454
12
09-27-2012 11:59 AM
AshakaThakore
New Contributor II
I have a silverlight application in which i have added a Map with a featurelayer

<esri:FeatureLayer   ID="MyFeatLayer" Visible="True"  Mode="OnDemand"  
                    Url="http://mymachine/arcgisserver/rest/services/mymapservice/MapServer/0"                                               
                     OutFields="G_KEY_COMP,OBJECTID,StreetAddressIdentify,gridnumber"
                     />

now my use selects an attribute-like a grid number, then in the code behind, i change MyFeatLayer's where clause using -
  myfeatlayer = (FeatureLayer)this.MyMap1.Layers["MyFeatLayer"];
                    this.MyMap1.Layers["MyFeatLayer"].Visible = true;
              
                myfeatlayer.Where = "gridnumber =100  ";
               
                myfeatlayer.Update();

Now how do I zoom to that particular feature layer so that it just shows what is currently inside the feature-layer(i.e. with where clause)

I did this
  this.MyMap1.Extent = myfeatlayer.FullExtent;

But it did not work

pl help
0 Kudos
12 Replies
AshakaThakore
New Contributor II
thanks a lot for the help...

I will go with the Featurelayer and changing the where clause

Thanks again
0 Kudos
AshakaThakore
New Contributor II
i am currently working on it..
and i will mark the answer on this thread...
how do i mark an answer

thanks
0 Kudos
deleted-user-ATjHIWsdQYmT
Occasional Contributor III
i am currently working on it..
and i will mark the answer on this thread...
how do i mark an answer

thanks


check this article:
http://resources.arcgis.com/node/4617
0 Kudos