<?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 Re: datagrid binding help in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datagrid-binding-help/m-p/147792#M3701</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: dbroux&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your are welcome.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The confusion is coming from the DataGridTextColumn which has a Dependency Property&amp;nbsp; called 'Binding' which has to be initialized with a Binding object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the C# code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - b is referencing the binding object&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - this.Binding is referencing the DP to initialize.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The XAML version is clearer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Jun 2010 13:10:07 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2010-06-07T13:10:07Z</dc:date>
    <item>
      <title>datagrid binding help</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datagrid-binding-help/m-p/147788#M3697</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;SPAN&gt;I got the source code of the Spatial Query sample which is a silverlight project and "converted" to WPF so that I can launch it in windows.&amp;nbsp; However, I don't see any text in my grid even though the number of rows returned is correct.&amp;nbsp; Please help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The sample is here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/samples/start.htm#SpatialQuery"&gt;http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/samples/start.htm#SpatialQuery&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When trying to convert to wpf I had to do the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Changed namespace System.Windows.Controls to Microsoft.Windows.Controls.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Change System.Windows.Controls.Primitives to Microsoft.Windows.Controls.Primitives&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Changed &amp;lt;slPrimitives:DataGridFrozenGrid Name="Root"&amp;gt; to &amp;lt;local:DataGridFrozenGrid Name="Root"&amp;gt;.&amp;nbsp; I copied the source code of DataGridFrozenGrid to my local namespace because the class is not found in the namespace Microsoft.Windows.Controls.Primitives.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Other minor changes.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please see the modified code in the attachment zip file.&amp;nbsp; I also attach the image how my datagrid looks like.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot!!&amp;nbsp; I really appreciate your time!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thao&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jun 2010 17:35:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datagrid-binding-help/m-p/147788#M3697</guid>
      <dc:creator>ThaoNguyen</dc:creator>
      <dc:date>2010-06-04T17:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: datagrid binding help</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datagrid-binding-help/m-p/147789#M3698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The initialization of the Binding property of the grid column is missing is the code of your DataGridTextColumn class :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public GraphicAttributeColumn()
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; Binding b = new System.Windows.Data.Binding("Attributes");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b.Converter = new DictionaryConverter();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BindingObj = b;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Binding = b; // MISSING
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That being said the usage of the Dictionary converter is not needed with WPF (nor with Silverlight 4.0), so instead of using your custom class, you could use the standard DataGridTextColumn class:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;slData:DataGridTextColumn&amp;nbsp; Width="80" SortMemberPath="STATE_NAME" Binding="{Binding Attributes[STATE_NAME]}" Header="State Name" /&amp;gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:06:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datagrid-binding-help/m-p/147789#M3698</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2021-12-12T16:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: datagrid binding help</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datagrid-binding-help/m-p/147790#M3699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: bbthao&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I replaced this.Binding = b with BindingObj = b.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought that would be OK.&amp;nbsp; But you were right!! After adding this.Binding = b, the values are displayed!&amp;nbsp; Thank you so much.&amp;nbsp; You saved lots of my time!!!&amp;nbsp; I'm pretty new to wpf; therefore, I'm not sure how things are connected.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jun 2010 12:39:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datagrid-binding-help/m-p/147790#M3699</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2010-06-07T12:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: datagrid binding help</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datagrid-binding-help/m-p/147791#M3700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; The initialization of the Binding property of the grid column is missing is the code of your DataGridTextColumn class :&amp;nbsp; &lt;BR /&gt; &lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public GraphicAttributeColumn()
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; Binding b = new System.Windows.Data.Binding("Attributes");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b.Converter = new DictionaryConverter();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BindingObj = b;
&lt;SPAN style="color:&amp;quot;Red&amp;quot;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Binding = b; // MISSING
&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt; &lt;BR /&gt; &lt;BR /&gt;That being said the usage of the Dictionary converter is not needed with WPF (nor with Silverlight 4.0), so instead of using your custom class, you could use the standard DataGridTextColumn class:&amp;nbsp; &lt;BR /&gt; &lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;slData:DataGridTextColumn&amp;nbsp; Width="80" SortMemberPath="STATE_NAME" Binding="{Binding Attributes[STATE_NAME]}" Header="State Name" /&amp;gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also tried your suggestion, it works as well. BTW, I had to remove RowStyle="{StaticResource MyCustomRow}" in the xaml. Leaving it produces a weird grid. I don't know why.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:01:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datagrid-binding-help/m-p/147791#M3700</guid>
      <dc:creator>ThaoNguyen</dc:creator>
      <dc:date>2021-12-11T08:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: datagrid binding help</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datagrid-binding-help/m-p/147792#M3701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: dbroux&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your are welcome.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The confusion is coming from the DataGridTextColumn which has a Dependency Property&amp;nbsp; called 'Binding' which has to be initialized with a Binding object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the C# code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - b is referencing the binding object&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; - this.Binding is referencing the DP to initialize.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The XAML version is clearer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jun 2010 13:10:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/datagrid-binding-help/m-p/147792#M3701</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2010-06-07T13:10:07Z</dc:date>
    </item>
  </channel>
</rss>

