<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic problem wit result of field task in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-wit-result-of-field-task/m-p/141809#M3548</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi to all, i've an error at the end of field task, in the FindDetails_SelectionChanged of my datagrid output.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If i find a polygon or a line all works good , if i find a point i have an error on the red istruction below when i try to obtain shape type.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe a spatial reference problem ? I'm using a find task on a service with a point layer inside. the layer spatial reference is 3857 and the map is 102100.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The error is "Object reference not set to an instance of an object."&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What can it be ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks GP&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DataGrid dataGrid = sender as DataGrid;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; int selectedIndex = dataGrid.SelectedIndex;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; if (selectedIndex &amp;gt; -1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; FindResult findResult = (FindResult) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; _Parent.MyDataGridOutput.QueryDetailsDataGrid.SelectedItem;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Graphic graphic = findResult.Feature;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; switch (graphic.Attributes["Shape"].ToString())&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; case "Polygon":&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; graphic.Symbol = LayoutRoot.Resources["DefaultFillSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; case "Polyline":&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; graphic.Symbol = _Parent.LayoutRoot.Resources["DefaultLineSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; case "Point":&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; graphic.Symbol = _Parent.LayoutRoot.Resources["DefaultMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Feb 2011 13:12:45 GMT</pubDate>
    <dc:creator>MarcoRosa</dc:creator>
    <dc:date>2011-02-28T13:12:45Z</dc:date>
    <item>
      <title>problem wit result of field task</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-wit-result-of-field-task/m-p/141809#M3548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi to all, i've an error at the end of field task, in the FindDetails_SelectionChanged of my datagrid output.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If i find a polygon or a line all works good , if i find a point i have an error on the red istruction below when i try to obtain shape type.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe a spatial reference problem ? I'm using a find task on a service with a point layer inside. the layer spatial reference is 3857 and the map is 102100.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The error is "Object reference not set to an instance of an object."&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What can it be ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks GP&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DataGrid dataGrid = sender as DataGrid;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; int selectedIndex = dataGrid.SelectedIndex;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; if (selectedIndex &amp;gt; -1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; FindResult findResult = (FindResult) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; _Parent.MyDataGridOutput.QueryDetailsDataGrid.SelectedItem;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Graphic graphic = findResult.Feature;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; switch (graphic.Attributes["Shape"].ToString())&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; case "Polygon":&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; graphic.Symbol = LayoutRoot.Resources["DefaultFillSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; case "Polyline":&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; graphic.Symbol = _Parent.LayoutRoot.Resources["DefaultLineSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; case "Point":&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; graphic.Symbol = _Parent.LayoutRoot.Resources["DefaultMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Feb 2011 13:12:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-wit-result-of-field-task/m-p/141809#M3548</guid>
      <dc:creator>MarcoRosa</dc:creator>
      <dc:date>2011-02-28T13:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: problem wit result of field task</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-wit-result-of-field-task/m-p/141810#M3549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;These two spatial reference are equivalent. Does your service include Shape field for points? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kindly check that &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;graphic.Attributes["Shape"] &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;is not null before you, call ToString() on it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Feb 2011 18:38:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-wit-result-of-field-task/m-p/141810#M3549</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-02-28T18:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: problem wit result of field task</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-wit-result-of-field-task/m-p/141811#M3550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jennifer,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i have deleted the service and recreate a new one with other point , same spatial reference , same all. Strange but this works ... now im' trying other points layer and i'll see.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks at the moment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;see un on other posts &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; have nice day&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2011 12:15:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-wit-result-of-field-task/m-p/141811#M3550</guid>
      <dc:creator>MarcoRosa</dc:creator>
      <dc:date>2011-03-01T12:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: problem wit result of field task</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-wit-result-of-field-task/m-p/141812#M3551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Keep in mind that the line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;switch (graphic.Attributes&lt;STRONG&gt;["Shape"]&lt;/STRONG&gt;.ToString())&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"Shape" is case sensitive. If you have a feature class that has the Shape field as "SHAPE" (all uppercase), you'll need to accommodate for that in your code, or else you will receive an error.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2011 17:26:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/problem-wit-result-of-field-task/m-p/141812#M3551</guid>
      <dc:creator>ErikEngstrom</dc:creator>
      <dc:date>2011-03-29T17:26:52Z</dc:date>
    </item>
  </channel>
</rss>

