<?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 New attribute binding in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/new-attribute-binding/m-p/601096#M15407</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not every graphic in our feature dataset has geometry and I'd like to add a column to the datagrid to identify this.&amp;nbsp; Before assigning the feature layer to the datagrid graphics layer, I loop thru the graphics and add an attribute called "HasShape" and assign a value of "True" or "False" (string data type not boolean).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I debug my code, the attribute list includes "HasShape" but this is the exception I get when I bind the data to the grid:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'HasShape' property not found on 'ESRI.ArcGIS.Client.Toolkit.DataSource.TempTypeMinus2021084955' &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the code I'm using to add the attribute:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Dim lyr As New ESRI.ArcGIS.Client.FeatureLayer lyr = CType(Mainpage.MyMap.Layers("MyFeatureLayer"), ESRI.ArcGIS.Client.FeatureLayer)&amp;nbsp; For Each item As ESRI.ArcGIS.Client.Graphic In lyr.Graphics &amp;nbsp;&amp;nbsp;&amp;nbsp; If item.Geometry Is Nothing Then &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; item.Attributes.Add("HasShape", "False")&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Else &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; item.Attributes.Add("HasShape", "True") &amp;nbsp;&amp;nbsp;&amp;nbsp; End If Next&amp;nbsp; Mainpage.MyDataGrid.GraphicsLayer = Mainpage.MyMap.Layers("MyFeatureLayer")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do NOT auto generate the datagrid's columns so here is my code to add the "HasShape" column:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim col As New DataGridTextColumn &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; col.Binding = New Windows.Data.Binding("HasShape") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; col.Header = "Has Shape" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; col.Width = New DataGridLength(80.0) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; col.IsReadOnly = True &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyDataGrid.Columns.Add(col)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please let me know if this is possible or maybe there's a better way to identify if there's a geometry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Sep 2013 17:45:23 GMT</pubDate>
    <dc:creator>JeffRogholt</dc:creator>
    <dc:date>2013-09-06T17:45:23Z</dc:date>
    <item>
      <title>New attribute binding</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/new-attribute-binding/m-p/601096#M15407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not every graphic in our feature dataset has geometry and I'd like to add a column to the datagrid to identify this.&amp;nbsp; Before assigning the feature layer to the datagrid graphics layer, I loop thru the graphics and add an attribute called "HasShape" and assign a value of "True" or "False" (string data type not boolean).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I debug my code, the attribute list includes "HasShape" but this is the exception I get when I bind the data to the grid:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'HasShape' property not found on 'ESRI.ArcGIS.Client.Toolkit.DataSource.TempTypeMinus2021084955' &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the code I'm using to add the attribute:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Dim lyr As New ESRI.ArcGIS.Client.FeatureLayer lyr = CType(Mainpage.MyMap.Layers("MyFeatureLayer"), ESRI.ArcGIS.Client.FeatureLayer)&amp;nbsp; For Each item As ESRI.ArcGIS.Client.Graphic In lyr.Graphics &amp;nbsp;&amp;nbsp;&amp;nbsp; If item.Geometry Is Nothing Then &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; item.Attributes.Add("HasShape", "False")&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Else &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; item.Attributes.Add("HasShape", "True") &amp;nbsp;&amp;nbsp;&amp;nbsp; End If Next&amp;nbsp; Mainpage.MyDataGrid.GraphicsLayer = Mainpage.MyMap.Layers("MyFeatureLayer")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do NOT auto generate the datagrid's columns so here is my code to add the "HasShape" column:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim col As New DataGridTextColumn &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; col.Binding = New Windows.Data.Binding("HasShape") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; col.Header = "Has Shape" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; col.Width = New DataGridLength(80.0) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; col.IsReadOnly = True &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyDataGrid.Columns.Add(col)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please let me know if this is possible or maybe there's a better way to identify if there's a geometry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 17:45:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/new-attribute-binding/m-p/601096#M15407</guid>
      <dc:creator>JeffRogholt</dc:creator>
      <dc:date>2013-09-06T17:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: New attribute binding</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/new-attribute-binding/m-p/601097#M15408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;col.Binding = New Windows.Data.Binding("&lt;STRONG&gt;Attributes[&lt;/STRONG&gt;HasShape&lt;STRONG&gt;]&lt;/STRONG&gt;")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Please let me know if this is possible or maybe there's a better way to identify if there's a geometry.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;You can bind to the Geometry itself but use a custom IValueConverter implementation. Then the geometry changes will be tracked automatically.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Sep 2013 03:47:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/new-attribute-binding/m-p/601097#M15408</guid>
      <dc:creator>DenisT</dc:creator>
      <dc:date>2013-09-07T03:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: New attribute binding</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/new-attribute-binding/m-p/601098#M15409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My fault, just noticed you were using FeatureDataGrid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In that case you can add your new Field description to lyr.LayerInfo.Fields.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure if there will be any side-effects during feature layer editing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Sep 2013 08:45:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/new-attribute-binding/m-p/601098#M15409</guid>
      <dc:creator>DenisT</dc:creator>
      <dc:date>2013-09-08T08:45:52Z</dc:date>
    </item>
  </channel>
</rss>

