<?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: How to update the attribute window after programatically select a feature? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-update-the-attribute-window-after/m-p/552782#M14962</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi thaviti:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you! The link answers my question. For convenience of the future reader, I copy-paste the follow from the link:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;=========================================================================================&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Re: iFeatureSelection.SelectionChanged doesn't work&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Author Michael Knight&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Date Jun 05, 2007&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Message IFeatureSelection.SelectionChanged updates the layer so it will update the display when you refresh. Why it doesn't fire the ActiveView Selection Changed Event I don't know. But if you are writing custom code to select features you must notify the display that the selection has changed. Try using ISelectionEvents. It will fire the ActiveView Selection Changed Event: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'vb &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pSelectionEvents As ISelectionEvents &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pSelectionEvents = pMap 'valid IMap refernce &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pSelectionEvents.SelectionChanged&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Michael Knight &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GIS Solutions Architect &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Contract Land Staff, LLC &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Stafford, Texas &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.contractlandstaff.com"&gt;http://www.contractlandstaff.com&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;================================================================================================&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jul 2012 17:01:22 GMT</pubDate>
    <dc:creator>SuiHuang</dc:creator>
    <dc:date>2012-07-05T17:01:22Z</dc:date>
    <item>
      <title>How to update the attribute window after programatically select a feature?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-update-the-attribute-window-after/m-p/552778#M14958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Everybody:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am writing code to programatically create new features, select features on the map, and keep the attribute window open to display the new feature in an edit session. However, even though I could select the feature and get it highlighted on the map, the attribute window does not display the new selected feature properly. Following is the code I used to select the feature:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;// This section of code is repeatly run to clear previously created feature and select newly created feature&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; &amp;nbsp;&amp;nbsp;&amp;nbsp; // select the new feature &amp;nbsp;&amp;nbsp;&amp;nbsp; (mapLayer as IFeatureSelection).Clear(); &amp;nbsp;&amp;nbsp;&amp;nbsp; (mapLayer as IFeatureSelection).SelectionSet.Add(newFeature.OID);&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // open the attribute window &amp;nbsp;&amp;nbsp;&amp;nbsp; UID attributeWinId = new UIDClass(); &amp;nbsp;&amp;nbsp;&amp;nbsp; attributeWinId.Value = "esriEditor.AttributeWindow"; &amp;nbsp;&amp;nbsp;&amp;nbsp; IAttributeWindow attributeWin = m_editor.FindExtension(attributeWinId) as IAttributeWindow; &amp;nbsp;&amp;nbsp;&amp;nbsp; attributeWin.Visible = true; &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;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // refresh the view &amp;nbsp;&amp;nbsp;&amp;nbsp; (m_Application.Document as IMxDocument).ActiveView.Refresh();&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For the first time this section of code is executed in an ArcMap edit session, the attribute window is opened (originally closed) and it displays the newly selected feature, but for the second time this code runs the displayed feature in attribute window wouldn't be updated automatically. How to synchonize it with the actual selection? Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2012 15:03:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-update-the-attribute-window-after/m-p/552778#M14958</guid>
      <dc:creator>SuiHuang</dc:creator>
      <dc:date>2012-07-04T15:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to update the attribute window after programatically select a feature?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-update-the-attribute-window-after/m-p/552779#M14959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Fire SelectionChanged after changing the selectionset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Everybody:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am writing code to programatically create new features, select features on the map, and keep the attribute window open to display the new feature in an edit session. However, even though I could select the feature and get it highlighted on the map, the attribute window does not display the new selected feature properly. Following is the code I used to select the feature:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
// This section of code is repeatly run to clear previously created feature and select newly created feature 
&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;&amp;nbsp; // select the new feature
&amp;nbsp;&amp;nbsp;&amp;nbsp; (mapLayer as IFeatureSelection).Clear();
&amp;nbsp;&amp;nbsp;&amp;nbsp; (mapLayer as IFeatureSelection).SelectionSet.Add(newFeature.OID);

&lt;SPAN style="color:#0000ff;"&gt; (mapLayer as IFeatureSelection).SelectionChanged(); &lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; // open the attribute window
&amp;nbsp;&amp;nbsp;&amp;nbsp; UID attributeWinId = new UIDClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp; attributeWinId.Value = "esriEditor.AttributeWindow";
&amp;nbsp;&amp;nbsp;&amp;nbsp; IAttributeWindow attributeWin = m_editor.FindExtension(attributeWinId) as IAttributeWindow;
&amp;nbsp;&amp;nbsp;&amp;nbsp; attributeWin.Visible = true;
&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;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; // refresh the view
&amp;nbsp;&amp;nbsp;&amp;nbsp; (m_Application.Document as IMxDocument).ActiveView.Refresh();
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;For the first time this section of code is executed in an ArcMap edit session, the attribute window is opened (originally closed) and it displays the newly selected feature, but for the second time this code runs the displayed feature in attribute window wouldn't be updated automatically. How to synchonize it with the actual selection? Thank you!&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:54:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-update-the-attribute-window-after/m-p/552779#M14959</guid>
      <dc:creator>ThavitinaiduGulivindala</dc:creator>
      <dc:date>2021-12-11T23:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to update the attribute window after programatically select a feature?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-update-the-attribute-window-after/m-p/552780#M14960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi thaviti:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I tried with the firing the event, but the Attribute Window still doesn't update. Do I need to implement event handler for "SelectionChanged"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Fire SelectionChanged after changing the selectionset.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2012 18:34:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-update-the-attribute-window-after/m-p/552780#M14960</guid>
      <dc:creator>SuiHuang</dc:creator>
      <dc:date>2012-07-04T18:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to update the attribute window after programatically select a feature?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-update-the-attribute-window-after/m-p/552781#M14961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The following link might be useful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://forums.esri.com/Thread.asp?c=93&amp;amp;f=1707&amp;amp;t=224203&amp;amp;g=1" rel="nofollow" target="_blank"&gt;http://forums.esri.com/Thread.asp?c=93&amp;amp;f=1707&amp;amp;t=224203&amp;amp;g=1&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi thaviti:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I tried with the firing the event, but the Attribute Window still doesn't update. Do I need to implement event handler for "SelectionChanged"?&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you!&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2012 16:11:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-update-the-attribute-window-after/m-p/552781#M14961</guid>
      <dc:creator>ThavitinaiduGulivindala</dc:creator>
      <dc:date>2012-07-05T16:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to update the attribute window after programatically select a feature?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-update-the-attribute-window-after/m-p/552782#M14962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi thaviti:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you! The link answers my question. For convenience of the future reader, I copy-paste the follow from the link:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;=========================================================================================&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Re: iFeatureSelection.SelectionChanged doesn't work&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Author Michael Knight&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Date Jun 05, 2007&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Message IFeatureSelection.SelectionChanged updates the layer so it will update the display when you refresh. Why it doesn't fire the ActiveView Selection Changed Event I don't know. But if you are writing custom code to select features you must notify the display that the selection has changed. Try using ISelectionEvents. It will fire the ActiveView Selection Changed Event: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'vb &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pSelectionEvents As ISelectionEvents &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pSelectionEvents = pMap 'valid IMap refernce &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pSelectionEvents.SelectionChanged&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Michael Knight &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GIS Solutions Architect &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Contract Land Staff, LLC &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Stafford, Texas &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.contractlandstaff.com"&gt;http://www.contractlandstaff.com&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;================================================================================================&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2012 17:01:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-update-the-attribute-window-after/m-p/552782#M14962</guid>
      <dc:creator>SuiHuang</dc:creator>
      <dc:date>2012-07-05T17:01:22Z</dc:date>
    </item>
  </channel>
</rss>

