<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>developers don't wear plaid</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/tlefor/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/tlefor/feed.xml</link>
    <description>and other observations from the fun world of technology</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:27:24 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Dynamics AX 2012: Meet the Table Control</title>
      <link>https://docs.microsoft.com/archive/blogs/tlefor/dynamics-ax-2012-meet-the-table-control</link>
      <pubDate>Tue, 20 Jan 2015 13:57:00 GMT</pubDate>
      <dc:creator><![CDATA[MicrosoftDude1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tlefor/2015/01/20/dynamics-ax-2012-meet-the-table-control/</guid>
      <description><![CDATA[Meet Dynamics AX 2012's Table Control.&nbsp;It's an unbound control that offering unique...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: arial,helvetica,sans-serif; font-size: large;">Meet Dynamics AX 2012's Table Control.&nbsp;It's </span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">an unbound control that offering unique interactions with </span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">the user providing functionality not available with other "table or t</span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">abular" controls like ListView and Grid. The table allows the developer </span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">to swap underlying controls on a cell by cell&nbsp;</span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">basis, and has the ability to show a large number of columns-defined</span><br /><span style="font-family: arial,helvetica,sans-serif; font-size: large;">at runtime if necessary.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: large;">At </span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">it's core, the table is a simple unbound&nbsp; table:</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/33/53/0474.table1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-33-53/0474.table1.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/33/53/0474.table1.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x197/__key/communityserver-blogs-components-weblogfiles/00-00-00-33-53/0474.table1.png" alt="" border="0" /></a>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: large;">It </span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">allows you to specify the number of columns/rows and as an option to show </span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">gridlines. The table allows you to indicate which types of controls can be </span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">hosted within each cell:</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/33/53/0676.table2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-33-53/0676.table2.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/33/53/0676.table2.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x214/__key/communityserver-blogs-components-weblogfiles/00-00-00-33-53/0676.table2.png" alt="" border="0" /></a>&nbsp;&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: large;">A </span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">powerful feature of the table is in its ability to vary the input type per </span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">CELL. This is done by the developer adding an edit control method that returns </span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">the modeled control type that should be represented in that cell</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/33/53/3618.table3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-33-53/3618.table3.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/33/53/3618.table3.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x215/__key/communityserver-blogs-components-weblogfiles/00-00-00-33-53/3618.table3.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: large;">Combined </span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">with the capabilities of the individual controls, different visuals and </span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">interactive uses are possible.</span></p>
<p>&nbsp;</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/33/53/3884.table4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-33-53/3884.table4.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/33/53/3884.table4.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/338x113/__key/communityserver-blogs-components-weblogfiles/00-00-00-33-53/3884.table4.png" alt="" border="0" /></a>&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/33/53/5381.table5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-33-53/5381.table5.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/33/53/5381.table5.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/289x491/__key/communityserver-blogs-components-weblogfiles/00-00-00-33-53/5381.table5.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p><span style="font-family: arial,helvetica,sans-serif; font-size: large;">With the Table control, </span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">the developer will be able to:</span></p>
<ul>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: large;">Model a table control on a </span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">form</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: large;">Set number of columns and</span><span style="font-family: arial,helvetica,sans-serif; font-size: large;"> rows</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: large;">Set height and width</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: large;">Add supported contained</span><span style="font-family: arial,helvetica,sans-serif; font-size: large;"> controls for interaction within each cell</span></li>
<ul>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: large;">from the AOT, select and right click on the control-&nbsp;</span><span style="font-family: arial,helvetica,sans-serif; font-size: large;">select add control</span></li>
<ul>&nbsp;&nbsp;&nbsp;</ul>
</ul>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: large;">On a cell by cell basis, the</span><span style="font-family: arial,helvetica,sans-serif; font-size: large;"> control calls the editcontrol method to learn what control to host in the</span><span style="font-family: arial,helvetica,sans-serif; font-size: large;"> cell</span></li>
</ul>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">FormControl </span><span style="font-family: courier new,courier; font-size: small;">editControl(int column, int row)</span><span style="font-family: courier new,courier; font-size: small;">{</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; if ((column == 2) || (column == 4))</span><span style="font-family: courier new,courier; font-size: small;">{</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (row &gt; 1)</span><span style="font-family: courier new,courier; font-size: small;">{</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return intEdit;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return editline;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; }</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; else</span><span style="font-family: courier new,courier; font-size: small;">{</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return editline;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; }</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">}</span></p>]]></content:encoded>
    </item>
    <item>
      <title>AX2012: Reading a string from an AOT resource</title>
      <link>https://docs.microsoft.com/archive/blogs/tlefor/ax2012-reading-a-string-from-an-aot-resource</link>
      <pubDate>Tue, 09 Sep 2014 07:06:16 GMT</pubDate>
      <dc:creator><![CDATA[MicrosoftDude1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tlefor/2014/09/09/ax2012-reading-a-string-from-an-aot-resource/</guid>
      <description><![CDATA[Sometimes the most basic of concepts become a&nbsp;challenge unless you've seen an example or have...]]></description>
      <content:encoded><![CDATA[<p>Sometimes the most basic of concepts become a&nbsp;challenge unless you've seen an example or have any idea that they exist at all. Within Dynamics AX, the use of resources to persist images, blobs or strings is one of those concepts. This is a quick example of how to obtain modeled data that has been persisted as an AOT resource within AX2012.</p>
<p>static str getResourceString(SysElementName _resName)<br />{<br />&nbsp;&nbsp;&nbsp; resourceNode resourceNode = SysResource::getResourceNode(_resName);<br />&nbsp;&nbsp;&nbsp; container stringContainier;</p>
<p>&nbsp;&nbsp;&nbsp; if (!resourceNode)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return '';<br />&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; resourceNode.AOTload();</p>
<p>&nbsp;&nbsp;&nbsp; stringContainier= SysResource::getResourceNodeData(resourceNode);<br />&nbsp;&nbsp;&nbsp; return conPeek(stringContainier, 1);<br />}</p>
<p>The string can contain default data, XML, HTML or whatever else your application needs.</p>]]></content:encoded>
    </item>
    <item>
      <title>Dynamics AX 2012: How Wide is my Grid Column?</title>
      <link>https://docs.microsoft.com/archive/blogs/tlefor/dynamics-ax-2012-how-wide-is-my-grid-column</link>
      <pubDate>Fri, 04 Oct 2013 14:25:10 GMT</pubDate>
      <dc:creator><![CDATA[MicrosoftDude1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tlefor/2013/10/04/dynamics-ax-2012-how-wide-is-my-grid-column/</guid>
      <description><![CDATA[So you want to know about column sizing?
You'd think the sizing of a column in a grid would be a...]]></description>
      <content:encoded><![CDATA[<p><strong>So you want to know about column sizing?</strong></p>
<p>You'd think the sizing of a column in a grid would be a fairly straightforward task. In Dynamics AX2012... it is, as you shouldn't ever have to care as the Dynamics framework implements a pretty sophisticated algorithm to attempt to size the columns in the grid to effectively show your data. If you're reading this blog post you are obviously among a very few select human beings.</p>
<p>1) You are enough of a nerd that you want to know how Dynamics AX sizes its columns, only because you want to know all there is to know about Dynamics AX.</p>
<p>2) You stumbled upon this post looking for something else, and you aren't sure why you are still reading this.</p>
<p>3) You are a friend or family member and you are being polite and reading this because I sent you a link.</p>
<p>4) You actually have a problem to solve and can't understand why your changes aren't effective in sizing the grid columns.</p>
<p>&nbsp;</p>
<p>If number 1 or 4 apply to you, continue reading, otherwise you have my permission to go walk the dog.</p>
<p>&nbsp;</p>
<p><strong>How does it work?</strong></p>
<p>Both the developer/customizer and the end user have the power to explicitly size columns, but without intervention, the Dynamics AX grid control will actually inspect the data that it is about to show, and size the column to make sure that most/all of the data is visible. That's right... the grid will size columns dynamically depending upon the data. If that wasn't enough... if the size of the column isn't wide enough to show the corresponding label... then it will also take that into account. For example if all of the data in a column were a Two -Character US State abbreviation such as "CA" then the grid would initially set it's size to 2 characters wide. However, it also looks at the column label... say for example "State." The grid also accommodates the label and ensures that the grid column width is wide enough to show the label as well. So, in this case the width of a "state" column would be 5 characters wide. As a developer, if you are authoring a control, you can override the algorithm that looks at the data by setting an explicit size on the EDT or Control associated with the data. However, min/max and label will still govern the size. That is, you cannot set an explicit width of 3 characters&nbsp;for a state and expect it to be 3 characters wide, as the grid layout engine will apply the min/max/label rule and make the column 5 characters wide. The assumption is that there isn't a scenario, where by default you want to show a column that is 0 characters wide, nor wider than the maximum width nor one with an truncated label. In the end, the end user is the one who may overrule all. It's his screen, he gets to decide if he needs a description column 20 characters wide, 40 characters wide or 80 characters wide. He does so by simply and interactively sizing the column and it will be "remembered" from session to session.</p>
<p>The following flow chart attempts to explain the algorithm. That's all for now. You may go walk the dog.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/33/53/6366.column%20sizing%20algorithm.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-33-53/6366.column-sizing-algorithm.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/33/53/6366.column%20sizing%20algorithm.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x536/__key/communityserver-blogs-components-weblogfiles/00-00-00-33-53/6366.column-sizing-algorithm.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>The Dynamics AX2012 Segmented Entry Control for Developers - Introduction</title>
      <link>https://docs.microsoft.com/archive/blogs/tlefor/the-dynamics-ax2012-segmented-entry-control-for-developers-introduction</link>
      <pubDate>Fri, 30 Aug 2013 09:35:10 GMT</pubDate>
      <dc:creator><![CDATA[MicrosoftDude1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tlefor/2013/08/30/the-dynamics-ax2012-segmented-entry-control-for-developers-introduction/</guid>
      <description><![CDATA[The Segmented Entry Control
You'll use this page to gain understanding about&nbsp;fundamental...]]></description>
      <content:encoded><![CDATA[<div><strong><span style="font-size: small;">The Segmented Entry Control</span></strong></div>
<div>You'll use this page to gain understanding about&nbsp;fundamental elements&nbsp;and use of the Segmented Entry Control.&nbsp;Look within Dynamics AX2012 for specific implementation examples. This brief overview introduces you to fundamental aspects and the things to look for in the examples in order to author your own instance of the Segmented Entry Control.</div>
<div>&nbsp;</div>
<div>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/33/53/3463.SegEntry.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-33-53/3463.SegEntry.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/33/53/3463.SegEntry.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/360x415/__key/communityserver-blogs-components-weblogfiles/00-00-00-33-53/3463.SegEntry.png" alt="" border="0" /></a></div>
<div><br />&nbsp;</div>
<div><span style="font-family: trebuchet ms,geneva; font-size: small;">1) Open/Close control for explicitly opening or closing the Contextual Fly-out</span></div>
<div><span style="font-family: trebuchet ms,geneva; font-size: small;">2) The Contextual Fly-out, with descriptions of each of the segments.</span></div>
<div><span style="font-family: trebuchet ms,geneva; font-size: small;">3) Lookup control for dropping a lookup window that contains segment values.</span></div>
<div><span style="font-family: trebuchet ms,geneva; font-size: small;">4) The lookup window aligns itself with the current segment for readability.</span></div>
<div><span style="font-family: trebuchet ms,geneva; font-size: small;">5) The lookup window contains an expand/collapse chevron that exposes optional functionality.</span></div>
<div><span style="font-family: trebuchet ms,geneva; font-size: small;">6) The lookup window will filter to show only valid segment values</span></div>
<div><span style="font-family: trebuchet ms,geneva; font-size: small;">7) Instance level control options are enabled or disabled here.</span></div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><span style="font-family: trebuchet ms,geneva; font-size: small;"><strong>LedgerDimensionAccountController</strong></span></div>
<div><span style="font-family: trebuchet ms,geneva; font-size: small;">The Segmented Entry Control is simply a means of interacting with the user. It presents data and allows the user to enter data. The actual behavior of the control is&nbsp;provided by X++ business logic. In AX6, the X++ business logic is implemented with a powerful <strong><em>LedgerDimensionAccountController </em></strong>class. This class responds to events raised by the Segmented Entry Control for populating, filtering and persisting segments based on other segment context.</span></div>
<div>&nbsp;</div>
<div><span style="font-family: trebuchet ms,geneva; font-size: small;"><strong>Surrogate Key Replacement</strong></span></div>
<div><span style="font-family: trebuchet ms,geneva; font-size: small;">A multi-segmented account number is a heavyweight construct to use as a key for representing a transaction. Therefore, an under-the-covers key or a "surrogate" key is used to represent the account number. AX6 introduce the concept of a surrogate key replacement. While a surrogate key replacement is available as&nbsp;a stand-alone construct, it is baked into the Segmented Entry Control.</span></div>
<div>&nbsp;</div>
<div><span style="font-family: trebuchet ms,geneva; font-size: small;"><strong>Steps for implementing a surrogate key replacement in AX6: (these are actual steps for working with AX6 Financials)</strong></span></div>
<div>&nbsp;</div>
<div><span style="font-family: trebuchet ms,geneva; font-size: small;">Create a relation to the <em><strong>DimensionAttributeValueCombination </strong></em>table.</span></div>
<div><span style="font-family: trebuchet ms,geneva; font-size: small;">Go to the relations node for the target table and create a new relation. </span><br /><span style="font-family: trebuchet ms,geneva; font-size: small;">Change the name of the relation to be <em><strong>LedgerDimension </strong></em>and the table for the relation to be <em><strong>DimensionAttributeValueCombination</strong></em>.&nbsp;</span></div>
<div><span style="font-family: trebuchet ms,geneva; font-size: small;">Right click on the <em><strong>LedgerDimension </strong></em>relation and&nbsp;choose New&nbsp;foreign key. This will create a new field in the DimensionAttributeValueCombination table. Name this field <strong><em>LedgerDimension</em></strong>. The EDT for this field should be set to <strong><em>LedgerDimensionAccount</em></strong>.</span></div>
<div>&nbsp;</div>
<div><span style="font-family: trebuchet ms,geneva; font-size: small;">Steps for managing a Segmented Entry Control&nbsp;with the&nbsp;<strong><em>LedgerDimensionAccountController </em></strong>Class</span></div>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;">&nbsp;1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Verify that the table that will hold the Foreign Key to the <strong><em>DimensionAttributeValueCombination</em> </strong>table is a datasource on the form.</span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;">2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Drag the LedgerDimension field from the datasource to the desired location on form design. This should add a <em>SegmentedEntry</em> control at this location on the form with appropriate DataSource and ReferenceField property values. Alternatively this can be done by adding a <em>SegmentedEntry</em> control to the design and manually setting the DataSource and ReferenceField properties.</span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;">3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Override the following methods on the form.</span></p>
<div>
<table style="width: 1428px; height: 252px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="614">
<p><span style="font-family: courier new,courier; font-size: small;">public class FormRun extends ObjectRun</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">{</span><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; LedgerDimensionAccountController <br />&nbsp;&nbsp;&nbsp; ledgerDimensionAccountController;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">}</span></p>
<p>&nbsp;<span style="font-family: courier new,courier; font-size: small;">public void init()</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">{</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;super();</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: courier new,courier; font-size: small;">ledgerDimensionAccountController = </span><span style="font-family: courier new,courier; font-size: small;">LedgerDimensionAccountController::construct(BackingDataSource_ds,</span><span style="font-family: courier new,courier; font-size: small;">fieldstr(BackingTable, LedgerDimension));</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">}</span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;"><strong><span style="color: #4f81bd;">Code Example: Methods overridden on the form</span></strong></span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;"><strong><span style="color: #4f81bd;"></span></strong></span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;">4.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Override the following methods on the <em>SegmentedEntry </em>control instance in the design.</span></p>
<div>
<table style="width: 1429px; height: 1017px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="710">
<p><span style="font-family: courier new,courier; font-size: small;">public void jumpRef()</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">{</span><span style="font-family: courier new,courier; font-size: small;"><br />&nbsp;&nbsp;&nbsp; ledgerDimensionAccountController.jumpRef();</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">}</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">public boolean validate()</span></p>
<p><span style="font-family: courier new,courier; font-size: small;"></span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; boolean isValid;</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; isValid = super();</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; isValid = ledgerDimensionAccountController.validate() &amp;&amp; isValid;</span></p>
<p>&nbsp;<span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; return isValid;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">}</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">public void segmentValueChanged(SegmentValueChangedEventArgs _e)</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">{</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp; super(_e);</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: courier new,courier; font-size: small;">ledgerDimensionAccountController.segmentValueChanged(_e);</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">}</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">public void loadSegments()</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">{&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; super();</span></p>
<p>&nbsp;<span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp; ledgerDimensionAccountController.parmControl(this);&nbsp;&nbsp;&nbsp; </span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; // The value of this parameter varies depending on the type of form.</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp; ledgerDimensionAccountController.parmDimensionAccountStorageUsage(...);</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp;</span><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ledgerDimensionAccountController.loadSegments();</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">}</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">public void loadAutoCompleteData(LoadAutoCompleteDataEventArgs _e)</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">{</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super(_e);</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: courier new,courier; font-size: small;">ledgerDimensionAccountController.loadAutoCompleteData(_e);</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">}</span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;"><strong><span style="color: #4f81bd;">Code Example: Methods overridden on the <em>SegmentedEntry</em> control instance</span></strong></span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;"><strong><span style="color: #4f81bd;"></span></strong></span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;">5.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; override the following method on the datasource field that backs the <em>SegmentedEntry</em> control.</span></p>
<div>
<table style="width: 1431px; height: 147px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="710">
<p><span style="font-family: courier new,courier; font-size: small;">public Common resolveReference(FormReferenceControl _formReferenceControl)</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">{</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; return ledgerDimensionAccountController.resolveReference();</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">}</span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p><strong><span style="color: #4f81bd; font-family: Calibri; font-size: x-small;">Code Example: Method overridden on the datasource field that backs the <em>SegmentedEntry</em> control</span></strong></p>]]></content:encoded>
    </item>
    <item>
      <title>Charts in Microsoft Dynamics AX 2012</title>
      <link>https://docs.microsoft.com/archive/blogs/tlefor/charts-in-microsoft-dynamics-ax-2012</link>
      <pubDate>Tue, 27 Aug 2013 10:49:00 GMT</pubDate>
      <dc:creator><![CDATA[MicrosoftDude1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tlefor/2013/08/27/charts-in-microsoft-dynamics-ax-2012/</guid>
      <description><![CDATA[&nbsp;
&nbsp;
&nbsp;
&nbsp;

Microsoft Dynamics AX 2012 has integrated support for Microsoft...]]></description>
      <content:encoded><![CDATA[<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><span style="font-family: arial,helvetica,sans-serif; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/33/53/2061.mschart.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-33-53/2061.mschart.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/33/53/2061.mschart.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x595/__key/communityserver-blogs-components-weblogfiles/00-00-00-33-53/2061.mschart.png" alt="" width="909" height="560" border="0" /></a></span></div>
<div><span style="font-family: arial,helvetica,sans-serif; font-size: small;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Microsoft Dynamics AX 2012 has integrated support for Microsoft .NET charts, easily&nbsp;</span>managed via X++.</span></div>
<div>&nbsp;</div>
<ul>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: small;">The Microsoft .NET team has extended the .NET API by introducing a Chart control. </span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Microsoft Dynamics Client enables simple use of this control by creating a new X++ wrapper class for the MSChart control: Graphics.</span></li>
<li><span style="font-family: arial,helvetica,sans-serif; font-size: small;">The Microsoft Dynamics Client&nbsp;has introduced a new companion control for the MSChart control: The Chart Toolbar control.</span></li>
</ul>
<div><span style="font-family: arial,helvetica,sans-serif; font-size: small;">With the Graphics class, an X++ developer can easily display their data graphical manner, without the need to utilize and understand&nbsp;the low-level .NET charting API. Simply utilize the Graphics class to initialize a chart with default display values,&nbsp;call a single "add data"&nbsp;API, then call&nbsp;Update&nbsp;to diplay the chart. In most cases, the developer will also want to provide the end user with the ability to manipulate the chart at runtime. In those cases, the developer will add the new Chart Toolbar to his form, and pass the toolbar an instance of the chart to be manipulated. That's it. An example use of charting can be found in the <em>Tutorial_Form_Graphics</em> form.</span></div>
<div>&nbsp;</div>
<div><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Start by adding Two Managed Controls to your form. One to host the Chart Control, the other to Host the Chart Toolbar</span></div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>For the purposes of this example name the chart control instance is&nbsp;"GraphControl"</div>
<div>&nbsp;</div>
<div><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Assembly: System.Windows.Forms</span></div>
<div><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Control: &nbsp;System.Windows.Forms.DataVisualization.Charting.Chart</span></div>
<div>&nbsp;</div>
<div><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Assembly: Microsoft.Dynamics.AX.Framework.Client.Controls</span></div>
<div><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Control: Microsoft.Dynamics.AX.Framework.Client.Controls.ChartToolBar</span></div>
<div>&nbsp;</div>
<div><span style="font-family: arial,helvetica,sans-serif; font-size: small;">Set both to have a Width of Column Width</span></div>
<div>&nbsp;</div>
<div><span style="font-family: arial,helvetica,sans-serif; font-size: small;">// Class Declaration</span></div>
<div>
<p><span style="font-family: courier new,courier; font-size: small;">public </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #00008b;"><span style="color: #00008b;"><span style="color: #00008b;">class</span></span></span></strong> FormRun <strong><span style="color: #00008b;"><span style="color: #00008b;"><span style="color: #00008b;">extends</span></span></span></strong> ObjectRun</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">{</span></p>
<p>&nbsp;&nbsp;&nbsp;<span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp; Graphics&nbsp;&nbsp;&nbsp; graphics;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; Microsoft.Dynamics.AX.Framework.Client.Controls.ChartToolBar chartToolbarControl;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">}</span></p>
</div>
<div>
<p>public</p>
<p><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #00008b;"><span style="color: #00008b;"><span style="color: #00008b;">void</span></span></span></strong> init()</span><span style="font-family: courier new,courier; font-size: small;">{</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #00008b;"><span style="color: #00008b;"><span style="color: #00008b;">super</span></span></span></strong>();</span></p>
<p><span style="font-family: courier new,courier;">// create an&nbsp;runtime reference to the toolbar control&nbsp;</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp; chartToolbarControl = chartToolbarControlHost.control();</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier;">// bind the tool bar to the&nbsp;chart&nbsp;control by passing an instance of the chart control to it</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; chartToolbarControl.set_ChartControl(<strong>graphControl</strong>.control());</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;</span>&nbsp;&nbsp;&nbsp;this.createSampleData();</p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; this.showchart();</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">}</span></p>
<p><span style="font-size: small;">void </span><span style="font-family: Consolas; font-size: small;"><span style="font-family: Consolas;">showchart()</span></span></p>
<p><span style="font-size: small;">{</span></p>
<p><span style="font-size: small;">// create an instance of the X++ to .NET abstraction class and bind it to the chart control</span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp; graphics =&nbsp; </span><span style="font-size: small;"><strong><span style="color: #00008b; font-family: Consolas;"><span style="color: #00008b; font-family: Consolas;"><span style="color: #00008b; font-family: Consolas;">new</span></span></span></strong><span style="font-family: Consolas;"><span style="font-family: Consolas;"> Graphics();</span></span></span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp; graphics.ManagedHostToControl(graphControl);</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">// set your abstracted chart options</span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp; graphics.parmCreateType(#CT_LEGEND | #CT_3D);</span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp; graphics.create();</span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp; graphics.parmTitle(</span><span style="font-size: small;"><span style="color: #9400d3; font-family: Consolas;"><span style="color: #9400d3; font-family: Consolas;"><span style="color: #9400d3; font-family: Consolas;">"@SYS95906"</span></span></span><span style="font-family: Consolas;"><span style="font-family: Consolas;">);</span></span></span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp; graphics.parmTitleXAxis(</span><span style="font-size: small;"><span style="color: #9400d3; font-family: Consolas;"><span style="color: #9400d3; font-family: Consolas;"><span style="color: #9400d3; font-family: Consolas;">"@SYS106478"</span></span></span><span style="font-family: Consolas;"><span style="font-family: Consolas;">);</span></span></span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp; graphics.parmTitleYAxis(</span><span style="font-size: small;"><span style="color: #9400d3; font-family: Consolas;"><span style="color: #9400d3; font-family: Consolas;"><span style="color: #9400d3; font-family: Consolas;">"@SYS3065"</span></span></span><span style="font-family: Consolas;"><span style="font-family: Consolas;">);</span></span></span></p>
<p>&nbsp;</p>
<p>// populate the chart with data</p>
<p>&nbsp;&nbsp;&nbsp;<span style="font-size: small;"><strong><span style="color: #00008b; font-family: Consolas;"><span style="color: #00008b; font-family: Consolas;"><span style="color: #00008b; font-family: Consolas;">while</span></span></span></strong><strong><span style="color: #00008b; font-family: Consolas;"><span style="color: #00008b; font-family: Consolas;"><span style="color: #00008b; font-family: Consolas;">select</span></span></span></strong><span style="font-family: Consolas;"><span style="font-family: Consolas;"> tmpAccountSum</span></span></span>&nbsp;</p>
<p><span style="font-size: small;"><strong><span style="color: #00008b; font-family: Consolas;"><span style="color: #00008b; font-family: Consolas;"><span style="color: #00008b; font-family: Consolas;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; order</span></span></span></strong><strong><span style="color: #00008b; font-family: Consolas;"><span style="color: #00008b; font-family: Consolas;"><span style="color: #00008b; font-family: Consolas;">by</span></span></span></strong><span style="font-family: Consolas;"><span style="font-family: Consolas;"> TransDate</span></span></span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp; {</span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; graphics.loadData( </span><span style="font-size: small;"><strong><span style="color: #00008b; font-family: Consolas;"><span style="color: #00008b; font-family: Consolas;"><span style="color: #00008b; font-family: Consolas;">date2str</span></span></span></strong><span style="font-family: Consolas;"><span style="font-family: Consolas;">(tmpAccountSum.TransDate,-</span></span><strong><span style="color: #ff0000; font-family: Consolas;"><span style="color: #ff0000; font-family: Consolas;"><span style="color: #ff0000; font-family: Consolas;">1</span></span></span></strong><span style="font-family: Consolas;"><span style="font-family: Consolas;">,-</span></span><strong><span style="color: #ff0000; font-family: Consolas;"><span style="color: #ff0000; font-family: Consolas;"><span style="color: #ff0000; font-family: Consolas;">1</span></span></span></strong><span style="font-family: Consolas;"><span style="font-family: Consolas;">,-</span></span><strong><span style="color: #ff0000; font-family: Consolas;"><span style="color: #ff0000; font-family: Consolas;"><span style="color: #ff0000; font-family: Consolas;">1</span></span></span></strong><span style="font-family: Consolas;"><span style="font-family: Consolas;">,-</span></span><strong><span style="color: #ff0000; font-family: Consolas;"><span style="color: #ff0000; font-family: Consolas;"><span style="color: #ff0000; font-family: Consolas;">1</span></span></span></strong><span style="font-family: Consolas;"><span style="font-family: Consolas;">,-</span></span><strong><span style="color: #ff0000; font-family: Consolas;"><span style="color: #ff0000; font-family: Consolas;"><span style="color: #ff0000; font-family: Consolas;">1</span></span></span></strong><span style="font-family: Consolas;"><span style="font-family: Consolas;">,-</span></span><strong><span style="color: #ff0000; font-family: Consolas;"><span style="color: #ff0000; font-family: Consolas;"><span style="color: #ff0000; font-family: Consolas;">1</span></span></span></strong><span style="font-family: Consolas;"><span style="font-family: Consolas;">, DateFlags::None),</span></span></span><span style="font-size: small;">&nbsp; tmpAccountSum.Txt,</span><span style="font-size: small;"> tmpAccountSum.Qty01);</span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp; }</span></p>
<p><span style="font-size: small;">&nbsp;&nbsp;&nbsp; graphics.showGraph();</span></p>
<p><span style="font-size: small;">}</span></p>
<p>&nbsp;</p>
<p>&nbsp;// create some sample data</p>
<p><span style="font-family: courier new,courier; font-size: small;">void </span><span style="font-family: courier new,courier; font-size: small;">createsampledata()</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">{</span><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; </span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.TransDate = </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #006400;"><span style="color: #006400;"><span style="color: #006400;">01\01\2007</span></span></span></strong>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.Qty01 = </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #ff0000;"><span style="color: #ff0000;"><span style="color: #ff0000;">1</span></span></span></strong>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.Txt = </span><span style="font-family: courier new,courier; font-size: small;"><span style="color: #8b0000;"><span style="color: #8b0000;"><span style="color: #8b0000;">'Group1'</span></span></span>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.insert();</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.TransDate = </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #006400;"><span style="color: #006400;"><span style="color: #006400;">02\02\2007</span></span></span></strong>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.Qty01 = </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #ff0000;"><span style="color: #ff0000;"><span style="color: #ff0000;">2</span></span></span></strong>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.Txt = </span><span style="font-family: courier new,courier; font-size: small;"><span style="color: #8b0000;"><span style="color: #8b0000;"><span style="color: #8b0000;">'Group1'</span></span></span>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.insert();</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.TransDate = </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #006400;"><span style="color: #006400;"><span style="color: #006400;">02\02\2007</span></span></span></strong>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.Qty01 = </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #ff0000;"><span style="color: #ff0000;"><span style="color: #ff0000;">1</span></span></span></strong>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.Txt = </span><span style="font-family: courier new,courier; font-size: small;"><span style="color: #8b0000;"><span style="color: #8b0000;"><span style="color: #8b0000;">'Group2'</span></span></span>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.insert();</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.TransDate = </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #006400;"><span style="color: #006400;"><span style="color: #006400;">03\03\2007</span></span></span></strong>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.Qty01 = </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #ff0000;"><span style="color: #ff0000;"><span style="color: #ff0000;">3</span></span></span></strong>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.Txt = </span><span style="font-family: courier new,courier; font-size: small;"><span style="color: #8b0000;"><span style="color: #8b0000;"><span style="color: #8b0000;">'Group2'</span></span></span>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.insert();</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.TransDate = </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #006400;"><span style="color: #006400;"><span style="color: #006400;">04\04\2007</span></span></span></strong>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.Qty01 = </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #ff0000;"><span style="color: #ff0000;"><span style="color: #ff0000;">1</span></span></span></strong>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.Txt = </span><span style="font-family: courier new,courier; font-size: small;"><span style="color: #8b0000;"><span style="color: #8b0000;"><span style="color: #8b0000;">'Group1'</span></span></span>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.insert();</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.TransDate = </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #006400;"><span style="color: #006400;"><span style="color: #006400;">04\04\2007</span></span></span></strong>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.Qty01 = </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #ff0000;"><span style="color: #ff0000;"><span style="color: #ff0000;">2</span></span></span></strong>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.Txt = </span><span style="font-family: courier new,courier; font-size: small;"><span style="color: #8b0000;"><span style="color: #8b0000;"><span style="color: #8b0000;">'Group3'</span></span></span>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.insert();</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.TransDate = </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #006400;"><span style="color: #006400;"><span style="color: #006400;">05\05\2007</span></span></span></strong>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.Qty01 = </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #ff0000;"><span style="color: #ff0000;"><span style="color: #ff0000;">3</span></span></span></strong>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.Txt = </span><span style="font-family: courier new,courier; font-size: small;"><span style="color: #8b0000;"><span style="color: #8b0000;"><span style="color: #8b0000;">'Group3'</span></span></span>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.insert();</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.TransDate = </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #006400;"><span style="color: #006400;"><span style="color: #006400;">05\05\2007</span></span></span></strong>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.Qty01 = </span><span style="font-family: courier new,courier; font-size: small;"><strong><span style="color: #ff0000;"><span style="color: #ff0000;"><span style="color: #ff0000;">2</span></span></span></strong>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.Txt = </span><span style="font-family: courier new,courier; font-size: small;"><span style="color: #8b0000;"><span style="color: #8b0000;"><span style="color: #8b0000;">'Group2'</span></span></span>;</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp; tmpAccountSum.insert();</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">}</span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>]]></content:encoded>
    </item>
    <item>
      <title>Dynamics AX2012: Integrating Managed Controls with Task Recorder</title>
      <link>https://docs.microsoft.com/archive/blogs/tlefor/dynamics-ax2012-integrating-managed-controls-with-task-recorder</link>
      <pubDate>Tue, 30 Apr 2013 07:38:00 GMT</pubDate>
      <dc:creator><![CDATA[MicrosoftDude1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tlefor/2013/04/30/dynamics-ax2012-integrating-managed-controls-with-task-recorder/</guid>
      <description><![CDATA[Integrating Managed Controls with Task Recorder:
Task Recorder Overview:
Task Recorder is a...]]></description>
      <content:encoded><![CDATA[<div class="ms-rte-layoutszone-inner"><strong class="ms-rteFontSize-3"><span style="font-size: large;">Integrating Managed Controls with Task Recorder:</span></strong></div>
<div class="ms-rte-layoutszone-inner"><strong class="ms-rteFontSize-3"><span style="font-size: x-small;">Task Recorder Overview:</span></strong></div>
<div class="ms-rte-layoutszone-inner"><span style="font-size: x-small;">Task Recorder is a feature of Dynamics AX that is used extensively by partners and customers to create process or learning documents for customer specific scenarios. <br /></span></div>
<div class="ms-rte-layoutszone-inner"><span style="font-size: x-small;">With Task Recorder, the user can document the&nbsp;specific steps for completing a task in AX. In record mode,&nbsp;Task Recorder creates a "step by step" record of user actions in a textual <br />format that is then used to generate PowerPoint or&nbsp;Word documents, complete with screen shots as appropriate.</span><span style="font-size: x-small;">The task recorder control panel can be found in Tools&gt;&gt;Task Recorder</span></div>
<div class="ms-rte-layoutszone-inner"><strong class="ms-rteFontSize-3"></strong>&nbsp;</div>
<div class="ms-rte-layoutszone-inner"><strong class="ms-rteFontSize-3"><span style="font-size: x-small;">Managed Control Integration with Task Recorder Overview:</span></strong></div>
<div class="ms-rte-layoutszone-inner"><span style="font-size: x-small;">Previously, every new control added to Dynamics needed to extend the sysTaskRecorder base class by creating a specialized class with methods that supported the types of events that they wanted recorded, and called <br />those methods when the event occurred. In addition, Task Recorder document generation needed to be extended with knowledge of the new base class in order to properly create documents based on the new events. </span></div>
<div class="ms-rte-layoutszone-inner"><span style="font-size: x-small;">The process wasn't documented and the process was cumbersome and therefore externally added controls via ActiveX were never included in Task Recorder recordings.</span></div>
<div class="ms-rte-layoutszone-inner">&nbsp;</div>
<div class="ms-rte-layoutszone-inner"><span style="font-size: x-small;">With the introduction of new managed controls in Dynamics AX2012, we created a simplified integration pattern, one in which a simple "generic" Task Recorder class could be used by any control.</span></div>
<div class="ms-rte-layoutszone-inner">&nbsp;</div>
<div class="ms-rte-layoutszone-inner"><span style="font-size: x-small;">This new class&nbsp;allows all new controls without specialized event recording needs to simply call into the generic 'record event' class, passing in a&nbsp;descriptive string, with supporting data if desired.&nbsp;</span></div>
<div class="ms-rte-layoutszone-inner"><span style="font-size: x-small;"><strong>Example:</strong></span></div>
<div class="ms-rte-layoutszone-inner"><em><span style="font-size: x-small;">Create an X++ event handler for a managed control&nbsp;event. In this example, we'll call task recorder to "record" that event.&nbsp;</span></em></div>
<div class="ms-rte-layoutszone-inner"><strong><span style="font-size: xx-small;">1) Add an <br />X++ event handler to respond to events raised by your control.<br /></span></strong></div>
<p><span style="font-size: xx-small;">You can define an X++ method and designate it as an event handler for events raised by your control. In this example, we're adding a form method. <br />While it's possible to use class methods, it's recommended that you use form methods.</span>&nbsp;</p>
<p><span style="font-size: xx-small;">In this example, we're passing in the ManagedHost instance... if you do this, a screenshot of the control will be taken, if no control is passed, no screenshot is taken.</span></p>
<p>&nbsp;</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="688">
<p>void ManagedHost_SelectedDateChanged(System.Object sender, System.Windows.Controls.SelectionChangedEventArgs e)<br />{<br />&nbsp;&nbsp;&nbsp; // the control doesn't need to be cast here... it's also available as a form global<br />&nbsp;&nbsp;&nbsp; System.Windows.Controls.DatePicker datePicker = sender as system.Windows.Controls.DatePicker;</p>
<p>&nbsp;&nbsp;&nbsp; str dateChangedValue;</p>
<p>&nbsp;&nbsp;&nbsp; if (datePicker )</p>
<p>&nbsp;&nbsp;&nbsp; {<br />&nbsp;dateChangedValue = datePicker.get_Text();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;SysTaskRecorder_Eventing::fire_UserSpecified(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strfmt("The user has changed the date to %1.", ManagedHostName), ManagedHost);<br />&nbsp;&nbsp;&nbsp; }<br />}</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;<strong><span style="font-size: xx-small;">2) Hook up the managed event handler</span></strong></p>
<p><span style="font-size: xx-small;">It is recommended that you define all of your event handlers in the <span style="text-decoration: underline;">init method of the form</span>.</span></p>
<p>&nbsp;<span style="font-family: Calibri;">// Glue code: <br />Hook the managed controls event to an X++ Event Handler:</span></p>
<p><span style="font-family: Courier;">&nbsp;&nbsp; M<span style="color: #0000ff;">anagedHost</span>.add_SelectedDateChanged(</span><span style="font-family: Courier;">new ManagedEventHandler(this,<strong>'<span style="color: #ff0000;">managedEventHandler_RecordDateChanged'</span></strong>)</span><span style="font-family: Courier;">);</span></p>
<p>&nbsp;</p>
<p><span style="font-family: Calibri;"><strong>Note&nbsp;on performance:</strong> Task recorder event SysTaskRecorder_Eventing::fireUserSpecified() is a expensive operation. It creates a XmlDocument and takes a screen capture. So we should fire the event <br />only when task is being recorded and should not call it for normal forms execution. To check if task is being recorded, use SysTaskRecorderEventManager::parmRecording() and if true, then call the <br />event.</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Dynamics AX2012: The Managed Control Host FAQ</title>
      <link>https://docs.microsoft.com/archive/blogs/tlefor/dynamics-ax2012-the-managed-control-host-faq</link>
      <pubDate>Mon, 29 Apr 2013 12:04:00 GMT</pubDate>
      <dc:creator><![CDATA[MicrosoftDude1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tlefor/2013/04/29/dynamics-ax2012-the-managed-control-host-faq/</guid>
      <description><![CDATA[&nbsp;
I'm the Senior Program Manager responsible for Controls and User Interaction for Dynamics AX...]]></description>
      <content:encoded><![CDATA[<div><strong></strong>&nbsp;</div>
<div><strong><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;">I'm the Senior Program Manager responsible for Controls and User Interaction for Dynamics AX 2009 and 2012. One of the controls that we introduced in AX2012 that&nbsp;I'm really excited about is the Managed Control Host. Like most new functionality it's a prime candidate for mis-use and overuse because it's cool.&nbsp; My guidance to you is to&nbsp;only use a managed control where a Dynamics&nbsp; AX control (or collection of controls) doesn't provide the user interaction that best represents the data that you are showing. The Managed Control Host effectively provides a Managed sandbox within an AX form that allows you to host any kind of WPF or Microsoft .NET control.&nbsp;&nbsp;&nbsp;Others have posted about how to use the control, so&nbsp; I thought it might be helpful if I published a list of common questions I get about the use of the Managed Control Host.</span></span></span></strong></div>
<div><strong></strong>&nbsp;</div>
<div><strong><span style="font-size: small;">Managed Control Host Frequently Asked <br />Questions:</span></strong></div>
<div><em></em>&nbsp;</div>
<div>
<div>
<p><span style="color: #3366ff;"><span style="font-family: Calibri; font-size: small;"><strong>I've decided that I need to add a managed control to my form, where do I start?</strong></span></span></p>
<p><span style="font-family: Calibri;"><span style="font-size: small;">Make sure that you don&rsquo;t introduce a control or family of controls with&nbsp;no visual consistency, no consistency in&nbsp;terminology no consistency in accessibility, usability, testability and any other abilities you can think of. That is, don't introduce a new way of presenting or interacting with data when a similar/same example already exists in the product. This leads to confusion for users, and a lack of trust of the overall implementation.</span></span></p>
<p><span style="color: #3366ff;"><span style="font-family: Calibri; font-size: small;"><strong>When I evaluate a design, or look at an existing managed control , what functionality should I consider?</strong></span></span><span style="color: #3366ff;"> <br /></span></p>
<p><strong><span style="color: #000000; font-family: Calibri; font-size: small;">Tooltips</span></strong></p>
<p><span style="color: #000000; font-family: Calibri; font-size: small;">Like other controls in the system, the&nbsp;control should provide tooltips.&nbsp;<br /></span>&nbsp;</p>
<p><strong><span style="color: #000000; font-family: Calibri; font-size: small;">UIAutomation</span></strong></p>
<p><span style="color: #000000; font-family: Calibri; font-size: small;">This interface is used by applications run by our sight impaired customers to navigate and interact with the control. This interface is also used by automated testing tools by our internal testing teams. It is highly <br />recomended that you implement the UIAutomation interface to ensure that your home-grown crontrols can be automated. In some cases, there are legal requirements to support sight-impaired users.</span></p>
<p>&nbsp;<strong><span style="color: #000000; font-family: Calibri; font-size: small;">High Contrast</span></strong></p>
<p><span style="color: #000000; font-family: Calibri; font-size: small;">When the sight impaired user runs his system in High Contrast mode, the control should run High Contrast mode as well.</span></p>
<p>&nbsp;<strong><span style="color: #000000; font-family: Calibri; font-size: small;">Alternative Languages</span></strong></p>
<p><span style="color: #000000; font-family: Calibri; font-size: small;">Your control MUST support the same alternative languages as Dynamics AX. The control should be able to dynamically switch to the alternative language, just as its host form does.</span></p>
<p>&nbsp;<strong><span style="color: #000000; font-family: Calibri; font-size: small;">RTL:</span></strong></p>
<p><span style="color: #000000; font-family: Calibri; font-size: small;">&nbsp;The control should support Right To Left languages. The control should be able to respond to a dynamic request to display its contents in RTL in support of Arabic, Hebrew. </span></p>
<p>&nbsp;<strong><span style="color: #000000; font-family: Calibri; font-size: small;">Resources:</span></strong></p>
<p><span style="color: #000000; font-family: Calibri; font-size: small;">&nbsp;Text strings and other end-user visuals that require translation should not be stored in the managed resources of the control, instead the string text should come from AX. This is necessary for support of alternative <br />languages and for consistency of labeling.</span></p>
<p>&nbsp;<span style="color: #000000; font-family: Calibri; font-size: small;"><strong>Task Recorder</strong></span></p>
<p><span style="color: #000000; font-family: Calibri; font-size: small;">WPF and Managed Controls need to integrate with existing Task Recorder functionality. </span></p>
<p>&nbsp;<strong><span style="color: #000000; font-family: Calibri; font-size: small;">TwC : Compiler options, etc.</span></strong></p>
<p><span style="color: #000000; font-family: Calibri; font-size: small;">&nbsp;Ensure that the control supports Trustworthy computing and other&nbsp; compiler options that thwart hacking.</span></p>
<p>&nbsp;<strong>Tab Sequence</strong></p>
<p>Your control should participate in, and be part of the user-expected flow of the tab sequence</p>
<p>&nbsp;</p>
<p><strong>Active Sizing</strong></p>
<p>When desired, if the form resizes your control should resize to ensure it remains a functional part of the form.</p>
<p>&nbsp;</p>
<p><strong>Operating System Regional and Language Settings</strong></p>
<p>When providing data&nbsp;displaying data&nbsp;that utilize regional settings, the control should respect the current Operating System display options.</p>
<p>&nbsp;&nbsp;</p>
<p><span style="color: #3366ff;"><span style="font-family: Calibri; font-size: small;"><strong>I am getting the error "ClrObject static method invocation error" when selecting my assembly in the Managed Control Selector form</strong></span></span></p>
<p><span style="font-family: Calibri;"><span style="font-size: small;">Check the following points:</span></span></p>
<p>-&nbsp;All the project references are <br />either added to the GAC or copied to Client\Bin</p>
<p>- Verify that you either have a <br />strong key signing the assembly&nbsp;or that you have delay signing, but not both.</p>
<p>&nbsp;</p>
<p><span style="font-family: Calibri; font-size: small;"><strong><em><span style="color: #3366ff;">How does this control manage to host WPF AND WinForms natively in a single control?</span></em></strong> <br /></span></p>
<p>We implemented two basic steps to accomplishing this:</p>
<ol>
<li>Hook up the HWND so it&rsquo;s on a window and gets/responds to Windows messages</li>
<li>Get access to the .NET object instance that is the control and call API&rsquo;s on it</li>
</ol>
<p>The only part that&rsquo;s different between a WinForms control and a WPF control is step 1. Once the HWND is hooked up, they&rsquo;re both just .NET objects that we want to call API&rsquo;s on. The fact that they have different base classes is irrelevant. So, if we can let the user pick any old .NET class that derives from one of the two proper base classes and then get step 1 accomplished, we can host either type.</p>
<p>&nbsp;If the control&nbsp;uses a class that derives from System.Windows.FrameworkElement, then we&nbsp;perform a&nbsp;WPF binding. Basically we just spin up a System.Windows.Interop.HwndSource instance and tell it what the parent HWND is where it'll be hosted and what the child WPF class is that we want hosted. Then we do a couple minor messaging hookups and call ShowWindow and everything magically works.&nbsp;When the&nbsp;HWND is hooked up, your X++ can interact with the hosted class instance and not care about the fact that it&rsquo;s actually WPF. It&rsquo;s just an object with some API&rsquo;s.Similarly if the control derives from System.Windows.Forms.Control,&nbsp;we manage a WinForms binding.&nbsp;Basically we just call NativeMethods.SetParent(), telling the control who it&rsquo;s new parent is. Then we do some minor messaging hookups and call ShowWindow and everything magically works. Again, the control's HWND is hooked up and X++ is interacting with the hosted class instance.</p>
<p><strong><em></em></strong>&nbsp;</p>
<p><strong><span style="color: #3366ff;">We already have Managed Controls like <em>Directory View</em> in AX 2009. How did we do this without a managed control host?</span></strong></p>
<p><span style="color: #000000;">AX 2009 does not have a general purpose means of using managed controls. Teams that had managed controls in AX 2009 used the ActiveX control host to wrap the managed control.&nbsp; This approach requires roll-your-own marshaling code added to each control. This marshaling is only possible by forcing the managed control to implement a COM interface to marshal calls and data between the managed control and X++. Using COM to marshal data back and forth is cumbersome, poor performing and requires much coding overhead by the creator of the control. In the case of directory view, it's not a data-intensive control and therefore, the performance impact isn't a concern. With a managed host control, adding a control in some cases is simply a matter of referencing it, and then adding a few lines of code to instantiate the control.</span></p>
<p>&nbsp;&nbsp;</p>
<p><strong><span style="color: #3366ff;">Will a Managed Control Host implicitly work with an Dynamics AX grid?</span></strong></p>
<p>The Managed Control Host was not created scenarios that include the need to add a managed control to a grid. That level of complexity and interactivity was not built into our design.</p>
<p>&nbsp;</p>
<p><strong><span style="color: #3366ff;">When I add a managed control to a form, how do I get it to be part of the tab sequence?</span></strong></p>
<p>In order for your hosted control (WPF in this case) to take part in the tab sequence, the control you are hosting must return true from its Focusable (CanFocus in WinForms) property.The properties you need to override are Focusable or CanFocus.</p>
<p>// this code provided as-is, with no warranty expressed or implied...IT'S JUST AN EXAMPLE PEOPLE.&nbsp;&nbsp;</p>
<p>&nbsp;For WPF controls, the code might look like this:</p>
<p><span style="font-family: courier new,courier;">Boolean ControlSourceWpf::CanFocus::get(){<br />&nbsp;&nbsp; Boolean canFocus = false;<br />&nbsp;&nbsp;&nbsp;&nbsp; if(this-&gt;uiElement != nullptr) <br />&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp; canFocus = this-&gt;uiElement-&gt;Focusable;<br />&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; return canFocus; <br />}</span></p>
<p>&nbsp;</p>
<p>For WinForms, the code might look like this:</p>
<p><span style="font-family: courier new,courier;">Boolean ControlSourceWinForms::CanFocus::get(){&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><br /><span style="font-family: courier new,courier;"> Boolean canFocus = false;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><br /><span style="font-family: courier new,courier;">&nbsp; if (this-&gt;hostedControl != nullptr {</span></p>
<pre><span style="font-family: courier new,courier;"> canFocus = this-&gt;hostedControl-&gt;<span style="font-size: x-small;">CanFocus</span> </span><br /><span style="font-family: courier new,courier;">&nbsp; }</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return canFocus;&nbsp;&nbsp;&nbsp; </span><br /><span style="font-family: courier new,courier;">&nbsp;}</span></pre>
<div><strong>How is my control sized?</strong></div>
<div>You can manage the sizing of your control yourself or you can let AX managed the sizing of your control.In both cases, you need to provide an initial size in your control. This is done by setting global PreferredSize property for Winforms or DesiredSize for WPF.</div>
<div>&nbsp;</div>
<div><strong>The control manages its own sizing:</strong></div>
<div>To allow the control to size itself, set the Managed Control Host Height and Width properties to Auto and the Sizing property to SizeToContent</div>
<div>&nbsp;</div>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="149">
<div><strong>Property</strong></div>
</td>
<td valign="top" width="168">
<div><strong>Value</strong></div>
</td>
<td valign="top" width="522">
<div><strong>&nbsp;</strong></div>
</td>
</tr>
<tr>
<td valign="top" width="149">
<div>Height</div>
</td>
<td valign="top" width="168">
<div>Auto</div>
</td>
<td valign="top" width="522">
<div>Let the control define the height</div>
</td>
</tr>
<tr>
<td valign="top" width="149">
<div>Width</div>
</td>
<td valign="top" width="168">
<div>Auto</div>
</td>
<td valign="top" width="522">
<div>Let the control define the width</div>
</td>
</tr>
<tr>
<td valign="top" width="149">
<div>Sizing</div>
</td>
<td valign="top" width="168">
<div>SizeToContent</div>
</td>
<td valign="top" width="522">
<div>AX subscribes to your controls sizing event and will resize the managed <br />host</div>
</td>
</tr>
</tbody>
</table>
<div>&nbsp;</div>
<div>AX has no idea what the initial size should be&hellip; to define an initial size in your control, you must set one of the following properties (Winforms/WPF differ) otherwise the initial size of your control will be 0,0 and you will not see your control.</div>
<div>&nbsp;</div>
<div>Control Properties</div>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="179">
<div>PreferredSize <br />(Winforms)</div>
</td>
<td valign="top" width="258">
<div>System.Drawing.Size(w,h)</div>
</td>
</tr>
<tr>
<td valign="top" width="179">
<div>DesiredSize <br />(WPF)</div>
</td>
<td valign="top" width="258">
<div>System.Drawing.Size(w,h)</div>
</td>
</tr>
</tbody>
</table>
<div>&nbsp;</div>
<div>&middot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <em>In this scneario, AX doesn&rsquo;t send any sizing events. Therefore if the control is managing it&rsquo;s size, it&rsquo;s best to remain a fixed size as the user may resize the host window and it becomes difficult to effectively keep a relative and useful control size in relation to the current window size.&nbsp;</em><em>&nbsp;</em></div>
<div>&middot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <em>AX will listen to sizing events from your control and respond, allowing the control to affect the size of the managed host, but not the size of the window. Only the user can resize the window.</em></div>
<div><em>&nbsp;</em></div>
<div>&nbsp;</div>
<div><strong>The Managed Control Host manages the sizing.</strong></div>
<div><strong>&nbsp;</strong></div>
<div>AX has no idea what the initial size should be&hellip; to define an initial size in your control, you must set one of the following properties (Winforms/WPF have differ) otherwise the initial size of your control will be 0,0 and you will not see your control.</div>
<div>&nbsp;</div>
<div>Control Properties (inherited from base control)</div>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="179">
<div>PreferredSize <br />(Winforms)</div>
</td>
<td valign="top" width="258">
<div>System.Drawing.Size(w,h)</div>
</td>
</tr>
<tr>
<td valign="top" width="179">
<div>DesiredSize <br />(WPF)</div>
</td>
<td valign="top" width="258">
<div>System.Drawing.Size(w,h)</div>
</td>
</tr>
</tbody>
</table>
<div><strong>&nbsp;</strong></div>
<div>&nbsp;</div>
<div>Working with the AX arrange engine to present your control with other UI elements:</div>
<div>&nbsp;</div>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="149">
<div><strong>Property</strong></div>
</td>
<td valign="top" width="168">
<div><strong>Value</strong></div>
</td>
<td valign="top" width="660">
<div><strong>&nbsp;</strong></div>
</td>
</tr>
<tr>
<td valign="top" width="149">
<div>Height</div>
</td>
<td valign="top" width="168">
<div>ColumnHeight</div>
</td>
<td valign="top" width="660">
<div>Control will have an initial height of PreferredSize, but this property enables resizing of the control.</div>
</td>
</tr>
<tr>
<td valign="top" width="149">
<div>Width</div>
</td>
<td valign="top" width="168">
<div>ColumnWidth</div>
</td>
<td valign="top" width="660">
<div>Control will have an initial width of PreferredSize, but this property enables resizing of the control.</div>
</td>
</tr>
<tr>
<td valign="top" width="149">
<div>Sizing</div>
</td>
<td valign="top" width="168">
<div>SizeToHost</div>
</td>
<td valign="top" width="660">
<div>AX will resize the control as the window grows/shrinks.</div>
</td>
</tr>
</tbody>
</table>
<div><strong>&nbsp;</strong></div>
<div>&middot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <em>ColumnHeight/Width tells the arrange engine that you&rsquo;ll accept a size other than to </em></div>
<div><em>the preferred size in order to fit on the window with other controls.</em></div>
<div>&middot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <em>In some cases, the user may size the window to a size in which your control will <br />not be able to present all of its contents. This is true for any control on an <br />AX form.</em></div>
<div><span style="font-family: Calibri;">&nbsp;</span>&nbsp;</div>
<p>&nbsp;<strong><span style="color: #3366ff;">I didn't create the control I'm using and it doesn't appear to provide initial sizing values... what can I do? </span></strong></p>
<p>A workaround -- ok "Hack" is that you can override the sizing behavior at runtime, by modifying the values of the host's sizing properties: <br />(the host is set for "SizeToContent"</p>
<p><span style="font-family: courier new,courier;">// set an initial size&nbsp; (WARNING: HACK ALERT)</span></p>
<p><span style="font-family: courier new,courier;">public void Init()</span><span style="font-family: courier new,courier;">{</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;super();</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MyManagedHost.width(600);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MyManagedHost.height(300);</span></p>
<p><span style="font-family: courier new,courier;">}</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier;">// allow the control to be resized with the form:</span></p>
<p><span style="font-family: courier new,courier;">public void resize(int _width, int _height)<br />{</span><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; MyManagedHost.widthMode(1);<br />&nbsp;&nbsp;&nbsp; MyManagedHost.heightMode(1);</span></p>
<p><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; super(_width, _height);</span><br />&nbsp;&nbsp;&nbsp;<span style="font-family: courier new,courier;">}</span></p>
<p>&nbsp;&nbsp;</p>
<div><strong><span style="color: #3366ff;">What should my Managed Event Handler Signature look like?</span></strong></div>
<div>The event-handler signature observes the following conventions:</div>
<p>The return type is <a href="http://msdn.microsoft.com/en-us/library/system.void.aspx"><span style="color: #1364c4;">Void</span></a>.</p>
<ul>
<li>
<div>The first parameter is named <em>sender</em> and is of type <a href="http://msdn.microsoft.com/en-us/library/system.object.aspx"><span style="color: #1364c4;">Object</span></a>. This is the object that raised the event.</div>
</li>
<li>
<div>The second parameter is named <em>e</em> and is of type <a href="http://msdn.microsoft.com/en-us/library/system.eventargs.aspx"><span style="color: #1364c4;">EventArgs</span></a> or a derived class of <a href="http://msdn.microsoft.com/en-us/library/system.eventargs.aspx"><span style="color: #1364c4;">EventArgs</span></a>.This is the event-specific data.</div>
</li>
<li>
<div>The method takes exactly two parameters.</div>
</li>
</ul>
<div><strong>public</strong> <strong>void</strong> managedEvent(System.Object&nbsp;o,&nbsp;System.EventArgs e)</div>
<p>&nbsp;From the MSDN Article:<a href="http://blogs.msdn.com/b/kcwalina/archive/2005/11/18/whyeventargs.aspx"><span style="color: #0000ff; font-family: Calibri;">http://blogs.msdn.com/b/kcwalina/archive/2005/11/18/whyeventargs.aspx</span></a></p>
<p>&nbsp;</p>
<p><strong><span style="color: #3366ff;">Will it be possible to add a Silverlight control using this Managed Host? </span></strong></p>
<p>No. Silverlight is not the same type of control as a WinForm or WPF control. WinForm and WPF are at their core, .NET controls. Silverlight controls have a similar API set available to them but it is implemented in a browser plug in, which is a different implementation than is required for WinForm or WPF controls.</p>
<p>&nbsp;</p>
</div>
</div>]]></content:encoded>
    </item>
    <item>
      <title>I'm not happy with my Hippocampus.</title>
      <link>https://docs.microsoft.com/archive/blogs/tlefor/im-not-happy-with-my-hippocampus</link>
      <pubDate>Wed, 03 Mar 2004 12:17:00 GMT</pubDate>
      <dc:creator><![CDATA[MicrosoftDude1]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/tlefor/2004/03/03/im-not-happy-with-my-hippocampus/</guid>
      <description><![CDATA[I'm Todd Lefor and I work on the Microsoft Business Framework team. I'm interested in all sorts of...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I'm Todd Lefor and I work on the Microsoft Business Framework team. I'm interested in all sorts of technology, including (but not limited to) digital video--I've actually been able to convince my wife that we need a TiVo&nbsp;AND a Media Center PC--computer animation, human interface, well done design&nbsp;and high performing transaction based financial systems. My first post is some abstract thoughts on object database technology, which is my focus within the Business Framework. </SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I am not happy with my hippocampus. I'm content with the way it looks <FONT color=red><SPAN style="COLOR: red">-</SPAN></FONT> I've had a sufficient number of head X-ray's in my life that it has a nice tan. I'm not happy with it because I fear that I've trained it to be really efficient. In fact, it filters much more than I'd like it to. Instead of filtering, I'd like it to do more long-term storing of data.</SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;</SPAN></FONT><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I heard a quote the other day from a supposed industry expert. He said...&nbsp; "I was <I><SPAN style="FONT-STYLE: italic">literally</SPAN></I> drowning in a sea of data." After I finished snorting soda out of my nose, I wondered what that person's obituary would read had that event been fatal:</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><B><FONT face=Arial size=2><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Arial">Industry veteran drowns in sea of data. Forensic database experts claim his data flotation device failed to inflate.</SPAN></FONT></B><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I think what he meant was that he was <I><SPAN style="FONT-STYLE: italic">figuratively</SPAN></I> drowning in a sea of data. Grammatical issues aside, I think he had a point. Data creation and data consumption are growing at a shocking rate. So much so that we've exceeded our ability to analyze and manage it. Part of the reason why it's so hard to manage is that we have a fixed way of thinking about our data. </SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I recall a simpler time when reading a book or coming across information in a newspaper when I would be introduced to a historical event or scientific phenomena. Growing up, we didn't own an encyclopedia. (Okay, my mom was a bit of a hypochondriac, and we had a set of medical encyclopedias - but none were applicable to my problem.<FONT color=navy><SPAN style="COLOR: navy">&nbsp;</SPAN></FONT> In those days, my experience or understanding was limited to my knowledge as of that time and place. My perception of the material was limited by my historical ability to relate it to some other event or logic known to me at the time. Today it's different. The Internet has become a large part of my learning experience. I sat down over the weekend to finish reading <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:PersonName style="BACKGROUND-POSITION: left bottom; BACKGROUND-IMAGE: url(res://ietag.dll/#34/#1001); BACKGROUND-REPEAT: repeat-x" tabIndex=0 w:st="on">Dan Brown</st1:PersonName>'s, "The DaVinci Code." It took me much longer to read this book than it would have without the Internet. I found myself setting the book down and picking up my laptop to scan the Internet for information on the historical ramblings of the book. <st1:PersonName style="BACKGROUND-POSITION: left bottom; BACKGROUND-IMAGE: url(res://ietag.dll/#34/#1001); BACKGROUND-REPEAT: repeat-x" tabIndex=0 w:st="on">Dan Brown</st1:PersonName> discusses different meanings (real or perceived) in several well known paintings. I had a more fulfilling adventure reading this book, given that I could stop and study the information presented, via the Internet. In the past, my perceptions and interpretations of the book would have been different - limited by my ability to relate the material to past experiences.</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Human learning is constrained by our ability to remember facts and details.&nbsp;I was able to experience the book more richly because I had the ability to analyze and research detailed facts that the author outlined. Some of that information had certainly crossed my path before. For example, I've seen DaVinci's "Last Supper," yet I could not recall colors, placement of objects or people in the painting as described. Why is it that some people have "photographic memories." I recently asked my friend Tim a question about Intel architecture. He went to his white board and drew a schematic that he had seen on a web site several months earlier. I went back to my computer and looked up the schematic and discovered that his drawing was perfect, including numeric details. Since I can't recall what I had for supper last night, it's clear to me that I could benefit from a supplemental digital memory.&nbsp; I've heard futurists describe the next phase of human evolution as one that includes integration with machines. If you can get thoughts of Robocop and the Six Million Dollar Man out of your head, there's room for real discussion here. The evolution of faster processing and larger data stores is historically charted and can be accurately predicted out into the future for several years, demonstrating that the growth of computational power and data store will eventually lead to the ability for a person to store virtually every experience that they have.&nbsp; If this is so, how will we manage this?&nbsp;How will I interact with this data? In a Virtual Data Reality, does data have pre-determined categories and shape, like real world objects? Who defines this data DNA (self-describing properties and behavior), and how does it get defined? If data has DNA<FONT color=red><SPAN style="COLOR: red">,</SPAN></FONT> is it then possible to create natural interaction and association between data?&nbsp; What kind of software is necessary to manage and interact with self-describing data? Today's relational models have strict and confined definitions of data and cryptic methods of retrieving that data. The gap between object oriented definition of data and relational storage hasn't been bridged in a manner that makes natural association and interaction possible. Object data needs to be managed by the application developer and marshaled to and from a relational store. </SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">To be able to bridge the object/relational gap<FONT color=red><SPAN style="COLOR: red">,</SPAN></FONT> a set of tools is needed with which the developer is allowed to think of data in terms of objects. The objects should be defined in terms of not just behavior<FONT color=red><SPAN style="COLOR: red">,</SPAN></FONT> but also descriptive attributes (read: metadata).&nbsp; Storage systems should be able to recognize attributes and create natural association and composition between objects. In this world, the developer should be able to create a person object and that person object should be able to relate to other person objects with similar attributes. The first step in this evolution is to create a development infrastructure in which data can easily be described as objects and then persisted and retrieved as objects without restrictions or knowledge of a particular data repository. </SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">We're working on tools that may someday provide this world for developers. Given our current limitations in processor power and storage, the associations and compositions will be defined by the developer (read: hard wired) providing a limited, but functional set of data relationships.&nbsp; Additionally, given the current state of object database technology and the need to integrate with existing relational data stores, the developer should be able to create mappings between object and relational data.&nbsp; When we do indeed have processing and storage bandwidth<FONT color=red><SPAN style="COLOR: red">,</SPAN></FONT> the object infrastructure and tools that we provide will be there to provide the fundamental building blocks for a Virtual Data Reality. </SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I'd like to ramble more and provide more details, but I can't remember what they are... damn hippocampus.</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;This posting is provided "AS IS" with no warranties, and confers no rights.</o:p></SPAN></FONT></P>]]></content:encoded>
    </item>
  </channel>
</rss>