<?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: Update DataGrid itemsource from a DataTable on button click in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-datagrid-itemsource-from-a-datatable-on/m-p/818920#M2733</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/345213" target="_blank"&gt;Marvis Kisakye&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For DataTable, your case is autogenerate column case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So at your viewmodel for datasource property you need to declare like this.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; DataTable _intersectionDataTable&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

        &lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; DataView IntersectionDataTable
        &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;get&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;_intersectionDataTable&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DefaultView&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
        &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next step, Make sure _intersectionDataTable datatable is initialized first. (Not necessary to create all columns). Just like this._intersectionDataTable = new DataTable() is good enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your button click event.&lt;/P&gt;&lt;P&gt;Make sure manipulations are going through with _intersectionDataTable property.&lt;/P&gt;&lt;P&gt;After all DataColumns generation and DataRows added statement finished, just call this statement.&amp;nbsp;&lt;SPAN class="" style="color: #d73a49; background-color: #ffffff;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #6f42c1; background-color: #ffffff;"&gt;NotifyPropertyChanged&lt;/SPAN&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #032f62; background-color: #ffffff;"&gt;&lt;SPAN class="" style="color: #032f62;"&gt;"I&lt;SPAN style="color: #3d3d3d;"&gt;ntersectionDataTable&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #032f62;"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;);&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently this way of solution is working for me, let me know if you encounter issue. Or just share your sample xaml and viewmodel. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/grin.png" /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 09:42:04 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-12T09:42:04Z</dc:date>
    <item>
      <title>Update DataGrid itemsource from a DataTable on button click</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-datagrid-itemsource-from-a-datatable-on/m-p/818919#M2732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a DataGrid (in a prowindow) whose itemsource is bound to a DataTable. When the user clicks a button, I want the &lt;SPAN&gt;DataGrid&amp;nbsp;&lt;/SPAN&gt;to update with values as stipulated by the binding on the button. I have confirmed that when the button is clicked, the DataTable values are updated but the &lt;SPAN&gt;DataGrid&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;doesn't update the user interface with the updated values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the xaml for the datagrid:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;!&amp;lt;DataGrid Grid.Row="1" Margin="5" Name="selectedFeatureGrid" &lt;BR /&gt; ScrollViewer.CanContentScroll="True" &lt;BR /&gt; ScrollViewer.VerticalScrollBarVisibility="Auto" &lt;BR /&gt; ScrollViewer.HorizontalScrollBarVisibility="Auto" &lt;BR /&gt; Style="{DynamicResource Esri_DataGrid}"&lt;BR /&gt; AutoGenerateColumns="True"&lt;BR /&gt; HorizontalAlignment="Stretch"&lt;BR /&gt; HeadersVisibility="Column" &lt;BR /&gt; RowHeaderWidth="0"&lt;BR /&gt; IsReadOnly="True"&lt;BR /&gt; SelectionMode="Single"&lt;BR /&gt; SelectedItem="{Binding Path=SelectedIntersectionRow}"&lt;BR /&gt; ItemsSource="{Binding Path=IntersectionDataTable, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"&lt;BR /&gt; AutoGeneratingColumn="selectedFeatureGrid_AutoGeneratingColumn"&amp;gt;&lt;BR /&gt; &amp;lt;/DataGrid&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/10927"&gt;Wolfgang Kaiser&lt;/A&gt;‌&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/86730"&gt;Uma Harano&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 May 2020 01:39:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-datagrid-itemsource-from-a-datatable-on/m-p/818919#M2732</guid>
      <dc:creator>MarvisKisakye1</dc:creator>
      <dc:date>2020-05-02T01:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Update DataGrid itemsource from a DataTable on button click</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-datagrid-itemsource-from-a-datatable-on/m-p/818920#M2733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/345213" target="_blank"&gt;Marvis Kisakye&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For DataTable, your case is autogenerate column case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So at your viewmodel for datasource property you need to declare like this.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; DataTable _intersectionDataTable&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

        &lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; DataView IntersectionDataTable
        &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;get&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;_intersectionDataTable&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DefaultView&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
        &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next step, Make sure _intersectionDataTable datatable is initialized first. (Not necessary to create all columns). Just like this._intersectionDataTable = new DataTable() is good enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your button click event.&lt;/P&gt;&lt;P&gt;Make sure manipulations are going through with _intersectionDataTable property.&lt;/P&gt;&lt;P&gt;After all DataColumns generation and DataRows added statement finished, just call this statement.&amp;nbsp;&lt;SPAN class="" style="color: #d73a49; background-color: #ffffff;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #6f42c1; background-color: #ffffff;"&gt;NotifyPropertyChanged&lt;/SPAN&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #032f62; background-color: #ffffff;"&gt;&lt;SPAN class="" style="color: #032f62;"&gt;"I&lt;SPAN style="color: #3d3d3d;"&gt;ntersectionDataTable&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #032f62;"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #24292e; background-color: #ffffff;"&gt;);&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently this way of solution is working for me, let me know if you encounter issue. Or just share your sample xaml and viewmodel. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/grin.png" /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:42:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-datagrid-itemsource-from-a-datatable-on/m-p/818920#M2733</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T09:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Update DataGrid itemsource from a DataTable on button click</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-datagrid-itemsource-from-a-datatable-on/m-p/818921#M2734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are multiple examples in the Pro SDK community samples repo that are displaying a DataTable in a DataGrid control.&amp;nbsp; You can use the GitHub search, on the top left on the&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples" rel="nofollow noopener noreferrer" target="_blank"&gt;Pro SDK community samples repo&lt;/A&gt;&amp;nbsp;page, to search for the term "DataTable" to find all samples.&amp;nbsp; For example:&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/2d6a30e2597c7a0079ae65b182f60a77e79aaef7/Map-Exploration/IdentifyWindow" rel="nofollow noopener noreferrer" target="_blank"&gt;Map-Exploration IdentifyWindow&lt;/A&gt;&amp;nbsp;is using a DataTable to autogenerate columns and display a table.&amp;nbsp; As Than mentioned in the reply above you need to call either NotifyPropertyChanged("...") or you can also define your DataTable property with a setter that calls&amp;nbsp;SetProperty(...).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Both&amp;nbsp;NotifyPropertyChanged and&amp;nbsp;SetProperty notify the UI that the DataTable property changed causing the UI to update its content.&amp;nbsp; So your ViewModel property would look like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; DataTable _intersectionDataTable &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;DataTable&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; DataTable IntersectionDataTable
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
	&lt;SPAN class="keyword token"&gt;get&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; _intersectionDataTable&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
	&lt;SPAN class="keyword token"&gt;set&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
		&lt;SPAN class="token function"&gt;SetProperty&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;ref&lt;/SPAN&gt; _intersectionDataTable&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;value&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; IntersectionDataTable&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You XAML should look like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;DataGrid&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;Grid.Row&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;1&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;Margin&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;5&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;Name&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;selectedFeatureGrid&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;   
	&lt;SPAN class="attr-name token"&gt;ScrollViewer.CanContentScroll&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;True&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;      
	&lt;SPAN class="attr-name token"&gt;ScrollViewer.VerticalScrollBarVisibility&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;Auto&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;        
	&lt;SPAN class="attr-name token"&gt;ScrollViewer.HorizontalScrollBarVisibility&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;Auto&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="style-attr language-css token"&gt;&lt;SPAN class="attr-name token"&gt;                            
	&lt;SPAN class="attr-name token"&gt;Style&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;="&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;DynamicResource Esri_DataGrid&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;
	&lt;SPAN class="attr-name token"&gt;AutoGenerateColumns&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;True&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;
	&lt;SPAN class="attr-name token"&gt;HorizontalAlignment&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;Stretch&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;
	&lt;SPAN class="attr-name token"&gt;HeadersVisibility&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;Column&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; 
	&lt;SPAN class="attr-name token"&gt;RowHeaderWidth&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;0&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;
	&lt;SPAN class="attr-name token"&gt;IsReadOnly&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;True&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;
	&lt;SPAN class="attr-name token"&gt;SelectionMode&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;Single&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;
	&lt;SPAN class="attr-name token"&gt;SelectedItem&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;{Binding Path&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;SelectedIntersectionRow}&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;
	&lt;SPAN class="attr-name token"&gt;ItemsSource&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;{Binding Path&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;IntersectionDataTable, Mode&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;OneWay}&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;DataGrid&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And to update / change the DataTable in your code you would have to first define the new DataTable and then call the DataTable's ItemSource property's setter:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// note: all columns are string types, listColumnNames contains the name for each column&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// and listValues contains a list of strings for each row&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; newDataTable &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;DataTable&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; col &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; listColumnNames&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
	newDataTable&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Columns&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Add&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;DataColumn&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;col&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Key&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;typeof&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; Caption &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; col&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Value &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; listValues&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
	&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; newRow &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; newDataTable&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;NewRow&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
	newRow&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ItemArray &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToArray&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
	newDataTable&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Rows&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Add&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;newRow&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// set the new property and notify the UI&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// this Update has to be made from the UI thread &lt;/SPAN&gt;
IntersectionDataTable &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; newDataTable&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Make sure that you call the IntersectionDataTable setter from the UI thread (Note that this is true for all properties that are databound to WPF controls).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:42:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-datagrid-itemsource-from-a-datatable-on/m-p/818921#M2734</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2021-12-12T09:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Update DataGrid itemsource from a DataTable on button click</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-datagrid-itemsource-from-a-datatable-on/m-p/818922#M2735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works beautifully. Thanks! By the way, what setting do you use to get your code snippet to be formatted? I tested all the available options to no avail.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2020 17:41:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-datagrid-itemsource-from-a-datatable-on/m-p/818922#M2735</guid>
      <dc:creator>MarvisKisakye1</dc:creator>
      <dc:date>2020-05-04T17:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Update DataGrid itemsource from a DataTable on button click</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-datagrid-itemsource-from-a-datatable-on/m-p/818923#M2736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't realize that SetProperty notifies the UI. Good to know. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2020 17:48:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-datagrid-itemsource-from-a-datatable-on/m-p/818923#M2736</guid>
      <dc:creator>MarvisKisakye1</dc:creator>
      <dc:date>2020-05-04T17:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Update DataGrid itemsource from a DataTable on button click</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-datagrid-itemsource-from-a-datatable-on/m-p/818924#M2737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have problems with this feature too.&amp;nbsp; It doesn't work for me when I reply through the Notification list in my geonet inbox (this might be fixed by now ... I haven't tried it in years), but I get it to work once I navigate to the geonet question link (by clicking on the geonet question).&amp;nbsp; From the geonet question link, you click "Reply" and then you click on the "..." menu in you reply edit menu bar,&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/490934_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;that opens up more options.&amp;nbsp; Next you click the "More" pull-down and choose syntax highlighter.&lt;BR /&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/490933_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;In the syntax highlighter popup choose the format from the pull down and paste the text.&amp;nbsp; The text will be highlighted to make code and xml more readable.&amp;nbsp; you can also use Ctrl+V to paste an image from your clipboard.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2020 20:57:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-datagrid-itemsource-from-a-datatable-on/m-p/818924#M2737</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2020-05-04T20:57:05Z</dc:date>
    </item>
  </channel>
</rss>

