<?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 ObjectID not visible in FeatureDataGrid in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384054#M9954</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just wondering why my ObjectID field would not be visible in my FeatureDataGrid?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My featurelayer.outfields is set to "*".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I look through my graphics contained in my graphics layer, I can see the 'OBJECTID' field within the attribute list.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, if I create an event on AutoGeneratingColumn and printout all of the attributes, the OBJECTID is never listed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas on why my OBJECTID field is not being picked up?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Jan 2013 15:24:08 GMT</pubDate>
    <dc:creator>jonathangamble</dc:creator>
    <dc:date>2013-01-09T15:24:08Z</dc:date>
    <item>
      <title>ObjectID not visible in FeatureDataGrid</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384054#M9954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just wondering why my ObjectID field would not be visible in my FeatureDataGrid?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My featurelayer.outfields is set to "*".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I look through my graphics contained in my graphics layer, I can see the 'OBJECTID' field within the attribute list.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, if I create an event on AutoGeneratingColumn and printout all of the attributes, the OBJECTID is never listed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas on why my OBJECTID field is not being picked up?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 15:24:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384054#M9954</guid>
      <dc:creator>jonathangamble</dc:creator>
      <dc:date>2013-01-09T15:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectID not visible in FeatureDataGrid</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384055#M9955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Looks like its build in the toolkit to not show the ObjectId field if the "*" is used.&amp;nbsp; I see this line of code in the toolkit source code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;// Don't show object id field.
if (featureLayer.LayerInfo.ObjectIdField == mappedKey)
{
 e.Cancel = true;
 return;
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want the ObjectId to show specifically add the fields to your OutFields List.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:40:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384055#M9955</guid>
      <dc:creator>ChrisTallman</dc:creator>
      <dc:date>2021-12-11T17:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectID not visible in FeatureDataGrid</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384056#M9956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Chris - Interesting find ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried setting my outFields to be 'OBJECTID' and it is still filtered out.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea how the 'mappedKey' variable is determined within that statement?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 17:11:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384056#M9956</guid>
      <dc:creator>jonathangamble</dc:creator>
      <dc:date>2013-01-10T17:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectID not visible in FeatureDataGrid</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384057#M9957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Update: does anyone know how I can manually add this column (objectID) back into the featuredatagrid?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's pretty frustrating that Esri has decided to hide this field by default.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 15:46:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384057#M9957</guid>
      <dc:creator>jonathangamble</dc:creator>
      <dc:date>2013-01-11T15:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectID not visible in FeatureDataGrid</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384058#M9958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can go ahead and leave the "*" in place on your layer. The OBJECTID field is ignored if you let the data grid AutoGenerate the Columns.&amp;nbsp; If you want to continue to see all the fields plus the OBJECTID field leave AutoGenerateColumns = True and add the OBJECTID manually.&amp;nbsp; Or you can add all the fields you would like to see and turn off the AutoGenerateColumns.&amp;nbsp; Here is the code to be able to do that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Add the following to the top:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And Edit your FeatureDataGrid as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;lt;esri:FeatureDataGrid Grid.Row="3" Grid.ColumnSpan="3" x:Name="MyDataGrid" &amp;nbsp; Map="{Binding ElementName=MyMap}" MaxHeight="400" AutoGenerateColumns="True"&amp;nbsp; &amp;nbsp; GraphicsLayer="{Binding Layers.[MyFeatureLayer], ElementName=MyMap}" &amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:FeatureDataGrid.Columns&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sdk:DataGridTextColumn Binding="{Binding OBJECTID}" Width="Auto" Header="Object ID"/&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:FeatureDataGrid.Columns&amp;gt; &amp;lt;/esri:FeatureDataGrid&amp;gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to add other fields just continue to add:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;lt;sdk:DataGridTextColumn Binding="{Binding OBJECTID}" Width="Auto" Header="Object ID"/&amp;gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Binding to the field from your data source.&amp;nbsp; You can add other field types to your datagrid in this same manner.&amp;nbsp; You can add a DataGridCheckBoxColumn and a DataGridTemplateColumn.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2013 11:36:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384058#M9958</guid>
      <dc:creator>ChrisTallman</dc:creator>
      <dc:date>2013-01-15T11:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectID not visible in FeatureDataGrid</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384059#M9959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Chris,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&amp;nbsp; This worked for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One follow up question for you - I have a dropdown box within my application where I select the layer I want to display in my featuredatagrid.&amp;nbsp; Because each layer might have a different ObjectID field name, I am dynamically binding the column once a change in the combo selection has occurred (See code below) ... is there anyway I could accomplish this type of binding within XAML?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
// Clear the columns
fdgAttributes.Columns.Clear();

// Add the new objectID field
ESRI.ArcGIS.Client.FeatureLayer fl = _vm.SelectedLayer;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
DataGridTextColumn col = new DataGridTextColumn();
col.Header = fl.LayerInfo.ObjectIdField;
col.Binding = new System.Windows.Data.Binding(fl.LayerInfo.ObjectIdField);
fdgAttributes.Columns.Add(col);

 // Set my featuredatagrid graphics layer
 fdgAttributes.GraphicsLayer = _vm.SelectedLayer as GraphicsLayer;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:40:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384059#M9959</guid>
      <dc:creator>jonathangamble</dc:creator>
      <dc:date>2021-12-11T17:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectID not visible in FeatureDataGrid</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384060#M9960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think the way you are doing it is probably the best solution.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I took a look at the code for the featuredatagrid to see about adding a property to allow the user to show/hide the objectid by a setting in xaml.&amp;nbsp; I found something interesting it doesnt seem like the objectid ever makes it to the Column AutoGeneration.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Im not sure if this is on purpose it would be interesting to have someone from ESRI comment on this.&amp;nbsp; From what I can tell the OBJECTID is being filtered out of the list of fields if you use AutoGenerateColumns.&amp;nbsp; I thought this was because of the code posted earlier in this thread but after some testing I dont ever see the OBJECTID field come through the OnAutoGeneratingColumn sub...&amp;nbsp; Its possible its a bug but the filtering seems to take place before the featuredatagrid is loaded, its interesting they check for the field but its never loaded...&amp;nbsp; I tired to find the filtering by looking for code looking at the LayerInfo.ObjectIdField but I dont see anything in the toolkit source code.&amp;nbsp; Must happen some where else in the base code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry for the rambling, it would be easy to add a property to be able to set if the objectid should be hidden or not.&amp;nbsp; Maybe in the next release this can be cleared up...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 15:31:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384060#M9960</guid>
      <dc:creator>ChrisTallman</dc:creator>
      <dc:date>2013-01-16T15:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: ObjectID not visible in FeatureDataGrid</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384061#M9961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Your rambling makes complete sense ... as I had the same thoughts!&amp;nbsp; I agree that the ObjectID should be displayed with an option to hide it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for the input.&amp;nbsp; I'll continue on with the way I have everything setup.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jon.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 17:52:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/objectid-not-visible-in-featuredatagrid/m-p/384061#M9961</guid>
      <dc:creator>jonathangamble</dc:creator>
      <dc:date>2013-01-16T17:52:19Z</dc:date>
    </item>
  </channel>
</rss>

