<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.infragistics.com/community/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Curtis Taylor&amp;#39;s Blog</title><subtitle type="html" /><id>http://www.infragistics.com/community/blogs/curtis_taylor/atom.aspx</id><link rel="alternate" type="text/html" href="http://www.infragistics.com/community/blogs/curtis_taylor/default.aspx" /><link rel="self" type="application/atom+xml" href="http://www.infragistics.com/community/blogs/curtis_taylor/atom.aspx" /><generator uri="http://communityserver.org" version="4.1.36.8414">Community Server</generator><updated>2009-06-05T14:25:00Z</updated><entry><title>Monster Services</title><link rel="alternate" type="text/html" href="/community/blogs/curtis_taylor/archive/2011/04/27/monster-services.aspx" /><id>/community/blogs/curtis_taylor/archive/2011/04/27/monster-services.aspx</id><published>2011-04-28T01:08:00Z</published><updated>2011-04-28T01:08:00Z</updated><content type="html">&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/ControlMonster2.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;This control monster loves controls. I have so many cool things I am itching to tell you about concerning many of our controls. Over time I will share more and more. However, my first priority at Infragistics involves service. The last few months I have been working onsite at various different companies providing consulting and custom training services. These clients discovered that Infragistics provides services that extend the support of our products to also include onsite or remote consulting and training. That&amp;rsquo;s right, Infragistics does consulting and training! And I am exceedingly excited at the quality of our services. Exceptional services with no excuses!&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;strong&gt;UI Consulting&lt;/strong&gt;&lt;br /&gt;Sometimes a solution begs for a custom solution or an expert onsite. I am privileged to be one of the engineers who will come to your company and show you how to solve the difficult problems when it comes to XAML UI development. Sometimes that might involve providing extra support working with or customizing certain Infragistics controls, such as the XamDataGrid or the XamPivotGrid. Other times, it might involve translating your killer ideas into performant custom controls utilizing current best practices for XAML control development. Regardless, customers have had me assist them onsite and remotely working on hard-to-solve XAML problems, writing custom solutions, reviewing their UI, ViewModel code and XAML, as well as providing guidelines for XAML best practices. This has included development working with Prism, WPF, Silverlight, MVVM, ToolKit controls and most lovingly, Infragistics controls!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;strong&gt;WPF and Silverlight Training&lt;/strong&gt;&lt;br /&gt;My job also includes providing training. You may know that Infragistics provides classes for both &lt;/span&gt;&lt;a target="_blank" href="http://www.infragistics.com/services/ui/default.aspx#Training" title="UI Training"&gt;&lt;span style="font-size:small;"&gt;User Interface &lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:small;"&gt;and &lt;/span&gt;&lt;a target="_blank" href="http://www.infragistics.com/services/ux/default.aspx#Training" title="UX Training"&gt;&lt;span style="font-size:small;"&gt;User Experience&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:small;"&gt; training. However, did you know that our engineers are trained and qualified to go onsite and provide custom training to match your need? Many customers have migrated to WPF or Silverlight, adopted our XAML controls and started working with these XAML based approaches only to discover how essentially different programming XAML UI is from previous .NET technologies. A couple of days of an intensive &amp;ldquo;Boot Camp&amp;rdquo; approach and we can provide your team with insights that will definitely boost your productivity with WPF, Silverlight or both! I love working with XAML. And if programming and designing XAML is not a joy for you, I suggest you take one of my classes! As I mentioned you can come attend a class or you can have us come onsite and provide a more customized class presentation. We can focus your training on any aspect of the techonology or any suite of controls.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;strong&gt;And what about the other technologies?&lt;/strong&gt;&lt;br /&gt;This Control Monster&amp;nbsp;eats XAML. However, we have other engineers with monstrously great skills in other .NET technologies such as WinForms, ASP.Net, as well as JQuery, SharePoint and .NET savvy Data Services.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;strong&gt;Did you mention UX?!?!&lt;/strong&gt;&lt;br /&gt;I work in the UI Services branch. However, we have an incredible team that focuses on usability design, review, consulting and training. These experts can review your designs, app or prototype, provide intelligent, case proven methods for improving the UX as well as come up with creative solutions to make your app more user friendly, visually stunning, and intelligently smart in its usability. This team also includes professional designers who can transform your app into a world-class visual and usable smorgasboard providing that professional look and feel! &lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;&lt;strong&gt;Try Us Out!&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:small;"&gt;If you are interested ping anyone in our company and let us know how we can serve you! I am excited to show you how awesome the technology is and how killer our controls are!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Consulting/ui-services.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;strong&gt;To learn more about UI Services&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;a target="_blank" href="http://www.infragistics.com/services/ui/default.aspx#UIUserInterfaceServices" title="More About UI Services"&gt;&lt;span style="font-size:small;"&gt;http://www.infragistics.com/services/ui/default.aspx#UIUserInterfaceServices&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;strong&gt;To learn more about UX Services&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;a target="_blank" href="http://www.infragistics.com/services/ux/default.aspx#UXUserExperienceServices" title="More About UX Servicces"&gt;&lt;span style="font-size:small;"&gt;http://www.infragistics.com/services/ux/default.aspx#UXUserExperienceServices&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br style="mso-special-character:line-break;" /&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Signature.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=282672" width="1" height="1"&gt;</content><author><name>CurtisTaylorInfragistics</name><uri>http://www.infragistics.com/profile/Nzg4OA==</uri></author><category term="WPF" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/WPF/default.aspx" /><category term="Silverlight" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Silverlight/default.aspx" /><category term="XAML" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/XAML/default.aspx" /><category term="Model-View-ViewModel" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Model-View-ViewModel/default.aspx" /><category term="UI" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/UI/default.aspx" /><category term="Training" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Training/default.aspx" /><category term="UX" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/UX/default.aspx" /><category term="Consulting" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Consulting/default.aspx" /><category term="Silverlight Consulting" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Silverlight+Consulting/default.aspx" /><category term="WPF Consulting" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/WPF+Consulting/default.aspx" /><category term="Design" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Design/default.aspx" /></entry><entry><title>XamDataGrid 101, Part 3 - Data Binding Basics</title><link rel="alternate" type="text/html" href="/community/blogs/curtis_taylor/archive/2010/11/06/xamdatagrid-101-data-binding-basics.aspx" /><id>/community/blogs/curtis_taylor/archive/2010/11/06/xamdatagrid-101-data-binding-basics.aspx</id><published>2010-11-07T02:23:00Z</published><updated>2010-11-07T02:23:00Z</updated><content type="html">&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/ControlMonster2.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;I love the XamDataGrid. I confess. It is an amazing control. There is so much I could tell you about it. So I&amp;rsquo;ve decided to dedicate another blog to show you the cool things this control can do with data.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;One queston users often ask is how do they get their data into the XamDataGrid and what should the data look like. I&amp;rsquo;m happy to report, the XamDataGrid is highly flexible when it comes to data. You may be working with DataTables already from SQL or a web service. Or you might be a WPF enthusiast using ObservableCollections everywhere. &lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;Both can be used directly with the XamDataGrid. The XamDataGrid can also work with regular Lists and Arrays. I&amp;rsquo;m also going to tell you about its support for IBindingList and CollectionView.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-size:small;"&gt;To start, I&amp;rsquo;ve whipped up a &lt;/span&gt;&lt;a href="http://download.infragistics.com/users/CurtisT/XDG3/SampleGridData.zip" title="Click here to download the sample."&gt;&lt;span style="font-size:small;"&gt;sample WPF 3.5 project&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:small;"&gt; using Visual Studio 2010 and NetAdvantage 2010.3. The sample shows four instances of the XamDataGrid, each with its own binding to a collection property in a ViewModel class. I will use this sample as a reference. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;a target="_blank" href="http://download.infragistics.com/users/CurtisT/XDG3/Images/00-AppWindowBig.PNG" title="Click here to enlarge..."&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG3/Images/00-AppWindow.PNG" border="0" style="max-width:550px;" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;There are two key thing about working with a collection of Records. One is the presentation of the data the other is the data itself. In standard WPF, records of data can be presented in any ItemsControl by using a DataTemplate. However, you must know the data beforehand in order to hard-code the DataTemplate. With the XamDataGrid, you don&amp;rsquo;t need a DataTemplate. The grid dynamically generates the layout for you with with selectable headers and specialized editors based on the type of each field in the collection of records. You can override this with Field and UnboundField declarations.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The XamDataGrid has an entire Record management system to ensure that the data is presented fast and virtualized. I rarely ever need to explicitly call any of these APIs, however, because I prefer to drive the UI from the data model (or more precisely with a ViewModel class). This means if something other than the UI changes my data, I need the UI to update for me. This also requires that when the UI changes the data, that the underlying model is changed as well. Fortunately, WPF and .NET provides all the tools I need to make this work.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;I will show you how to make this work with four types of collections. As I mentioned earlier, the project &amp;ldquo;SampleGridData&amp;rdquo; contains a ViewModel with four properties that are bound to four instances of the XamDataGrid in application View. The four properties are composed of types ObservableCollection, CollectionView, BindingList, and DataTable. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG3/Images/01-DataTypes.PNG" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;"&gt;I always prefer to have my ViewModel coupled with a View and declared within the XAML directly. And then bound to the DataContext of the main layout Panel in order to reference properties and commands anywhere within that layout. The advantage to this approach is that Visual Studio and Expression Blend will actually instantiate the ViewModel and show the data in the designer. This is huge when working with the XamDataGrid since this is one of those controls that require data in order to show what the presentation of the data will look like in design mode. And speaking of design mode, if your data comes from a service, you can qualify your code with a check for design mode in order to show sample data and not try to call your service when in design mode. This will keep Visual Studio and Blend from trying to do too much. To check that code is being instantiated in the designer, you can call the static method: &lt;/span&gt;&lt;/span&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;DesignerProperties.GetIsInDesignMode()&lt;/span&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG3/Images/02-ViewModelBinding.PNG" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;Some things about this sample: the XamDataGrid is refactored into its own UserControl since the same layout construct is repeated four times. The downside to this simplification is that the UserControl view does not have the instance of the ViewModel so you will have to go back to the main window XAML in order to see the data in action in design mode. The sample project also utilized a DispatcherTimer to periodically update the data in order to test dynamic updating of the UI. The amazing thing is that the Timer works in design mode, so while working in the designer you will see the data update while you are working. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The first collection shown in the sample is an ObservableCollection of &amp;lsquo;UserInfo&amp;rsquo; objects. &amp;lsquo;UserInfo&amp;rsquo; is a simple class composed of three properties to communicate the Username, Password, and Age. The class implements INotifyPropertyChanged. This way when the DispatcherTimer changes the Password property during runtime, the UI will be notified of the change and update dynamically.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;ObservableCollection implements INotifyCollectionChanged. That means we don&amp;rsquo;t have to do anything to notify the UI when items are added or removed from this observable collection. The timer will also add records to the collection at runtime which illustrates that the XamDataGrid bound to this collection will automatically update. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG3/Images/03-ObservableCollection.PNG" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-size:small;"&gt;There is a specialized class that can act as a wrapper to collection called CollectionView. WPF uses CollectionView in ItemsControls as a type of implicit ViewModel of your data. This collection wrapper class is used to handle sorting, filtering, grouping and keeping track of the current item. For more information, Bea Stollnitz has a great &lt;/span&gt;&lt;a target="_blank" href="http://bea.stollnitz.com/blog/?p=38" title="Beal Stollnitz Blog about CollectionView"&gt;&lt;span style="font-size:small;"&gt;blog posting about CollectionView&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;. XamDataGrid supports this class so you can take advantage of some of its features. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG3/Images/04-CollectionView.PNG" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;In the ViewModel class you will see that the ObservableCollection is assigned to the CollectionView as CollectionView is simply a wrapper to your data. As a result, the two XamDataGrids will always be in synch. One feature that the sample shows off is the tracking of the current item. To support this feature, you must enable the &amp;lsquo;IsSynchronizedWithCurrentItem&amp;rsquo; property in the XamDataGrid. This will cause the CollectionView.CurrentItem property to return the currently selected Record in the XamDataGrid. To demonstrate this the sample binds CollectionView.CurrentItem to a TextBlock. I&amp;rsquo;ve also overrode the ToString method in the UserInfo class to return the Username for that record.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG3/Images/05-IsSynchronizedWithCurrentItem.PNG" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The System.ComponentModel assembly contains the BindingList class. This class implements IBindingList. IBindingList is a standard .NET class and users of WinForms will probably be familiar with it. IBindingList supports notification for adding and removing items. The notification model in IBindingList is not supported by standard WPF controls (WPF moved to ObservableCollection). However, to be flexible with existing .NET desktop solutions, XamDataGrid supports this interface. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG3/Images/06-BindingList.PNG" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="mso-no-proof:yes;"&gt;There is a feature in the XamDataGrid that allows users to add records from within the grid UI itself. This UI will actually instantiate the record and add it to your data. However, to use this feature your collection must implement IBindingList or &lt;/span&gt;&lt;span lang="EN" style="mso-no-proof:yes;mso-ansi-language:EN;"&gt;IEditableCollectionView. Fortunately, the BindingList class implements IBindingList for you and like CollectionView, BindingList wraps another collection. The sample ViewModel does just that, the property for this third grid is a BindingList that wraps the first ObservableCollection. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span lang="EN" style="mso-no-proof:yes;mso-ansi-language:EN;"&gt;GridView.xaml enables AllowAddNew:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG3/Images/07-FieldLayoutSettings.PNG" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;"&gt;And the BindingList sample shows the Add Record UI working within the XamDataGrid:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG3/Images/08-AddingRecords.PNG" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;If you decide to take this approach and wrap your collection in BindingList to support the Add New record feature, you must take additional steps to support updating the collection when records are added to the coupled collection and when properties are changed in those records. As you may remember, I have the timer adding records to the ObservableCollection and modifying the Password property. Since the BindingList wrapper does not communicate the notifications directly to the UI, I needed to implement the update myself. To do this I simply needed to implement two event handler methods. One for the CollectionChanged event on the collection and one for the PropertyChanged event for each record in the collection. In the ViewModel you will see both of these events assigned handlers.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Consolas;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;&lt;span style="font-size:x-small;"&gt;UsersObservableCollection.CollectionChanged&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;&lt;span style="font-size:x-small;"&gt;+=&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;UsersObservableCollection_CollectionChanged;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;"&gt;&amp;hellip;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Consolas;"&gt;user.PropertyChanged&amp;nbsp;+=&amp;nbsp;UsersObservableCollection_PropertyChanged;&lt;/span&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;span style="font-size:small;"&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;span style="font-size:small;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;For both handlers, I simply communicate to the BindingList to update its binding to the coupled source collection:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:Consolas;"&gt;UsersBindingList.ResetBindings();&lt;/span&gt; &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="font-size:small;"&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;

&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;span style="font-size:small;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;With that change, the changes I make in the first two XamDataGrid instances and by the timer will now be communicated to this third XamDataGrid causing all three to be in-synch.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG3/Images/09-EditingRecords.PNG" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;Finally, the XamDataGrid sample does not synch with the first ObservableCollection at all. In fact, this powerhouse data structure does not use my UserInfo class at all. DataTable is a workhorse object that treats a block of data as tabular rows and columns. This leads to a type of virtual table that takes the place of properties defined for each column. Usually, DataTables are generated automatically from a data base or XML. In this sample, the ViewModel will generate a DataTable programmatically to match the ObservableCollection from the start. I did not go so far as to try to synchronize this table with the others. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG3/Images/10-DataTable.PNG" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;When working with DataTables, be aware you do not have a collection of objects such as the ObservableCollection of UserInfo objects. Instead you have a data representation of the UI grid which is simply mapped to the XamDataGrid respective of the ways you define your Columns. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;To assign the DataTable to the XamDataGrid, you must use the DefaultView property on the DataTable. DefaultView is of type &amp;lsquo;DataView&amp;rsquo;. This object is a wrapper on the data which implements IBindingList. This means the DataTable will update when the user changes the data in the view and that you can use the Add New record feature in the XamDataGrid. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG3/Images/11-DataTableBinding.PNG" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;DataTable is a powerful feature in .NET and having it accessible to use with XamDataGrid is a huge convenience for many. However, since you do not have a nice class to work with in your ViewModel to implement logic that affect the data, the temptation (for people who need to do those kinds of things) is to place that logic in the code-behind by accessing fields in the records in the UI directly. I always recommend placing your logic in the ViewModel rather than the code-behind as you can better test the code (using unit testing) and will keep the UI data driven. However, I could write a book about all the ways you can use DataTables and best practices for following a data driven model. So instead, I will continue to provide useful tidbits of &amp;ldquo;killer control&amp;rdquo; info along the way.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;Until next time, have fun with our products &amp;ndash; they are truly killer!&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Signature.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;span style="font-family:Calibri;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;a href="http://download.infragistics.com/users/CurtisT/XDG3/SampleGridData.zip" title="Click here to download the source code..."&gt;&lt;span style="font-size:small;"&gt;Download source code here...&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=258628" width="1" height="1"&gt;</content><author><name>CurtisTaylorInfragistics</name><uri>http://www.infragistics.com/profile/Nzg4OA==</uri></author><category term="XamDataGrid" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/XamDataGrid/default.aspx" /><category term="Data Binding" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Data+Binding/default.aspx" /><category term="DataTables" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/DataTables/default.aspx" /><category term="IsSynchronizedWithCurrentItem" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/IsSynchronizedWithCurrentItem/default.aspx" /><category term="INotifyPropertyChanged" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/INotifyPropertyChanged/default.aspx" /><category term="IBindingList" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/IBindingList/default.aspx" /><category term="CollectionView" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/CollectionView/default.aspx" /><category term="MVVM" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/MVVM/default.aspx" /><category term="ResetBindings" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/ResetBindings/default.aspx" /><category term="ViewModel" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/ViewModel/default.aspx" /><category term="BindingList" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/BindingList/default.aspx" /><category term="ObservableCollection" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/ObservableCollection/default.aspx" /><category term="AllowAddNew" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/AllowAddNew/default.aspx" /></entry><entry><title>XamDataGrid 101, Part 2 - Custom Colors</title><link rel="alternate" type="text/html" href="/community/blogs/curtis_taylor/archive/2010/10/26/xamdatagrid-101-part-2.aspx" /><id>/community/blogs/curtis_taylor/archive/2010/10/26/xamdatagrid-101-part-2.aspx</id><published>2010-10-26T08:15:00Z</published><updated>2010-10-26T08:15:00Z</updated><content type="html">&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/ControlMonster2.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;b style="mso-bidi-font-weight:normal;"&gt;&lt;span style="mso-no-proof:yes;"&gt;I&amp;rsquo;m back!&lt;/span&gt;&lt;/b&gt;&lt;span style="mso-no-proof:yes;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:Calibri;"&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;Sorry, but I&amp;rsquo;ve been very busy creating killer custom controls for customers. Did you know Infragistics does consulting? We help clients who need to create and solve custom solutions, whether that be customizing Infragistics controls or creating new ones from scratch. We do everything from UX design to complete engineering. I wish I could tell you more about some of the cool Silverlight controls we created for this one customer. However, client privileges prevent me from going into detail. So instead I want to show you a sample WPF application I put together the last couple of weeks to demonstrate the various Brush properties hidden away in the XamDataGrid.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;First of all, as you know Infragistics WPF products come with several packaged Themes. These themes set various brushes in several controls to produce a consistent skinned look. You can also create your own Themes or access resources to manipulate specific brushes within a Theme.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;On the other hand, another approach to working with our controls is through customization. As a WPF afficionado, you know that ControlTemplates are the empowering factor for complete customization. If you look in your friendly Infragistics installation folder, you will find a folder names DefaultStyles for each XAML-based product installed. This folder contains all ControlTemplates for each control so that you might have access to them.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&amp;nbsp;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/DefaultStyles.PNG" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;However, if you just want to change the border in a cell or the foreground color for a selected row in the XamDataGrid, there is no need to assign a complete Template. We provide quick access to various brushes and ContentPresenter styles for every brush in the XamDataGrid. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-size:small;"&gt;Download the &lt;/span&gt;&lt;a href="http://download.infragistics.com/users/CurtisT/XDG2/XamDataGridColors.zip"&gt;&lt;span style="font-size:small;"&gt;attached project&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:small;"&gt; to see how to access several key styles that affect colors in the XamDataGrid. The attached project is using our latest version of NetAdvantage for WPF, version 2010.3! It is using WPF4 with Visual Studio 2010 (or Expression Blend 4). The application generates a list of Color Pickers and a XamDataGrid with sample data. The color pickers allow you to apply colors to various parts of the XamDataGrid in real-time. It might prove to be a handy way to test your color ideas. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/Overall.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The application assigns simple SolidColorBrushes to each part. It will not apply Gradient brushes or other types of brushes. However, anywhere a color is assigned, any other type of WPF brush can take its place.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/ColorPicker.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;On careful examination of the application, you will see that the first group of colors in the list are Foreground brushes. Looking at the first brush, you will notice the label describes where in the object model the brush is found. The first one is found in the ForegroundStyle property on the CellValuePresenter style. ForegroundStyle and the other Foreground colors are ContentPresenter styles. When the content is text, then properties such as Foreground, FontWeight, and FontSize can be customized here. When this style is assigned to a Field or all Fields in a FieldLayout, then those cells Foreground presenters will be set.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/color01.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The project illustrates the Model-View-ViewModel pattern. It also illustrates using ObservableCollections and INotifyPropertyChanged to support dynamic updating of properties. The ViewModel is bound in such a way to support data rendering in the Visual Studio and Blend designers. The MainView.xaml file contains the declarations and bindings for the colors list and the XamDataGrid with it&amp;rsquo;s assignments to a custom CellValuePresenter, DataRecordCellArea, LabelPresenter, and HeaderLabelArea styles. Finally, there is a ColorPickerEx class that extends the XamColorPicker to support sharing Recent colors across all used color pickers (as a convenience to using this application).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/Project.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;The XamDataGrid supports multiple selection models. Individual cells can be selected. Whole rows can be selected. And non-contiguous cells can be selected. Each cell and header button supports a different look or state when enabled, active, selected and when the mouse is over the cell or header. For example, the next brush in the colors list sets the ForegroundSelectedStyle, TextBlock.Foreground brush. This is seen for selecting multiple cells.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/color02.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;ForegroundActiveStyle styles the cell ContentPresenter for the cell that is active. An active cell is the cell that you can edit when working with editable data.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/color03.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;And the ForegroundHoverStyle styles the ContentPresenter that is applied to the cell that is below the mouse when the mouse moves over the grid. This is an effect which communicates what will be activated when clicking down on the mouse button.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/color04.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;Several users have asked about changing the ForegroundStyle and Background brushes when a Record is selected. To do that a DataTrigger can be utilized to trigger the style change in the CellValuePresenter when the Record.IsSelected property is changed. Look for this DataTrigger in MainView.xaml to see how this is hooked up to the color in the ViewModel.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/color05.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/color06.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;While the foreground brushes must be taken from the content for the ContentPresenter styles. Background brushes do not involve ContentPresenter styles. These are simply Brush styles. The BackgroundHover brush in the CellValuePresenter demonstrates this brush. When the mouse moves over the cell this brush is applied to the cell Background.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/color07.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;BackgroundActive affects the active cell. Keep in mind if the active cell is a text editor and the text editor background is not transparent, then you will see the BackgroundActive brush around the opaque editor.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/color08.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;BackgroundSelected affects selected cells. Note, you can select multiple cells by holding the Shift key while selecting and a non-contiguous selection by holding the Ctrl key.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/color09.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The CellValuePresenter style also lets us set the BorderBrush and BorderThickness properties for every cell. With these properties you can make the cells resemble a spreadsheet look.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/color10.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;Like most spreadsheets programs, you may want to use a different brush color for selected cell borders. The CellValuePresenter style also contains the BorderSelectedBrush property for that purpose.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/color11.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;For additional customization, the DataRecordCellArea style also provides access to properties that affect cell styling. The sample touches on two of these brushes.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;To style the brushes in the header labels, there is the LabelPresenter style and the HeaderLabelArea style. HeaderLabelArea is most useful for customizing the presentation of the header buttons. The LabelPresenter style though will allow setting the Foreground brush for all the header labels.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/color12.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;For the background brushes in the header labels, there are three states. The LabelPresenter Background brush is the default brush for all header labels.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/color13.jpg" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;LabelHighlight brush in the LabelPresenter style is used for when the mouse is over the label.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/color14.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;However, when a brush is selected, to override this brush you must access a brush used in the control template &amp;ndash; LabelHighlight2. This is used by Theming, so you must access it using the ComponentResourceKey accessor. Keep in mind, that if you use a Theme, then this brush will be utilized by that Theme. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/color15.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;Finally, the last brush in the colors list is the Background brush for the XamDataGrid itself. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDG2/Images/ColorsList.PNG" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;That&amp;rsquo;s it for now. Download the &lt;/span&gt;&lt;a href="http://download.infragistics.com/users/CurtisT/XDG2/XamDataGridColors.zip"&gt;&lt;span style="font-size:small;"&gt;source code for the sample here &lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:small;"&gt;and have fun. I am eager to write more about our controls. With the latest release of version 2010.3 of our products, there is much going on here at infragistics. Until next time, enjoy! &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Signature.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=256732" width="1" height="1"&gt;</content><author><name>CurtisTaylorInfragistics</name><uri>http://www.infragistics.com/profile/Nzg4OA==</uri></author><category term="WPF" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/WPF/default.aspx" /><category term="XamDataGrid" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/XamDataGrid/default.aspx" /><category term="XAML" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/XAML/default.aspx" /><category term="xamColorPicker" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamColorPicker/default.aspx" /><category term="CellValuePresenter" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/CellValuePresenter/default.aspx" /><category term="Model-View-ViewModel" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Model-View-ViewModel/default.aspx" /><category term="LabelPresenter" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/LabelPresenter/default.aspx" /></entry><entry><title>XamDataGrid 101, Part 1 - Blend-Savvy Overview</title><link rel="alternate" type="text/html" href="/community/blogs/curtis_taylor/archive/2010/08/16/xamdatagrid-101-part-1.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="442465" href="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.24.58.72/XDG101.zip" /><id>/community/blogs/curtis_taylor/archive/2010/08/16/xamdatagrid-101-part-1.aspx</id><published>2010-08-16T12:21:00Z</published><updated>2010-08-16T12:21:00Z</updated><content type="html">&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/ControlMonster2.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;The premier control of the WPF NetAdvantage suite is definitely the XamDataGrid. The Infragistics data grid trumps all similar type of controls everywhere. Not only do I get paid to say that, but as a user of our controls I have found the XamDataGrid to be fast, highly customizable, and fast (which is worth repeating). &amp;lt;smile&amp;gt; Since the grid is highly customizable, there are many parts of the object model you can approach for styling and formatting. I am going to cover some of the more popular ways to customize the grid.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal;"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Creating a Sample Project&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Clearly, the coolest thing about the XamDataGrid is how intelligently it will format data for you. Simply bind a collection to the grid and it will extract data fields from properties and assign editors with default formatting. To illustrate this point, let&amp;rsquo;s create a WPF 4.0 project in Expression Blend with sample data and bind the sample data to the XamDataGrid.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Create a new WPF Application project in Expression Blend 4. For this project it is important to make sure that you choose .NET version 4.0. For part of this project we will be using the XamColorPicker control which is one of the new 4.0 controls in NetAdvantage. I&amp;rsquo;ve named my test project XDG101.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image01.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Next add resources to NetAdvantage for WPF. Right-click on the References folder in the Project panel.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In Blend you will need to navigate to the folder which contains the DLL for the assemblies. Navigate to the Program Files folder and locate the Infragistics\NetAdvantage 2010.2 folder.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image02.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Within this folder there are two folders we must refer to: Both the WPF and the WPFCommon folders contain DLLs we will be using. Note that the WPFCommon folder is there to faciliate common DLLs shared with the WPF Data Visualization version of NetAdvantage.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the &lt;b style="mso-bidi-font-weight:normal;"&gt;WPFCommon\Bin&lt;/b&gt; folder add the &amp;ldquo;&lt;b style="mso-bidi-font-weight:normal;"&gt;InfragisticsWPF4.v10.2.dll&lt;/b&gt;&amp;rdquo; to the project References.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Return to the Add References dialog and add the following DLLs from the &lt;b style="mso-bidi-font-weight:normal;"&gt;WPF\CLR4.0\Bin&lt;/b&gt; folder:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal;"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;InfragisticsWPF4.Controls.Editors.XamColorPicker.v10.2.dll&lt;br /&gt;InfragisticsWPF4.DataPresenter.v10.2.dll&lt;br /&gt;InfragisticsWPF4.Editors.v10.2.dll&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Now from the Data panel in Blend add data to the project to be used at run time. This time I am adding the data to &amp;ldquo;This document&amp;rdquo; which will add the instantiation of the data source to the main window rather than to the application.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image03.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;On adding sample data, by default a Collection is added composed of a class that contains two properties. The first property should be a string with Lorem ipsum formatting. Leave this property as is except click on the name of the property to rename the property to &amp;lsquo;ProductName&amp;rsquo;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image04.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;The second default property should already be a Boolean type. Rename this property to &amp;lsquo;ForSale&amp;rsquo;.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;Next click on the Plus icon button to the right of the Collection in the Data panel to add another property. Clicking on the button will add a default String property. Rename the property &amp;lsquo;Icon&amp;rsquo;. To the right of the property you can customize the type and formatting. Change the newly added property to be Type Image.&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image05.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;On changing to type Image leave the Location field blank. This will cause Blend to add sample images to the project for you. With Location you can add a folder of your own Images to the data.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Next add a property named ID of Type Number of Length 4.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image06.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Next add a property named ColorKey of Type String, Format Colors.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image07.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Finally, add a property named Price of Type Number and Length 2.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Next we will add an instance of the XamDataGrid to main layout of the Main Window. You can quickly locate the XamDataGrid by using the search field in the Assets panel.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image08.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Double click on the XamDataGrid in the Assets list or drag it into the design space for the window.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Blend will position the element on adding it by setting certain Layout properties. To make the XamDataGrid fill the entire Window, reset all properties in the Layout category of the Properties panel. Reset is an option in the Advanced Layout menu which will clear a property to its default setting. The Advanced Layout menu is accessed by clicking on the rectangle to the right of every property.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image09.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To assign the data to the XamDataGrid, select the control in the Objects and Timeline panel and locate the DataSource property in the Content category of the Properties panel.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Access the DataSource Advanced Layout menu and choose the Data Binding option.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image10.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the subsequent Create Data Binding dialog we will assign the Collection to the binding expression. This is located in the Data Field tab.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image11.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;After selection the Collection and closing the dialog, you will find the XamDataGrid populated with the data we created.&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image12.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal;"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Data Formatting&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Next I will illustrate a few things you can do to customize the formatting for the data. First of all notice the labels for each header how they match the property names. We will want to override the text for the labels. We will want to override the width and height of the icon. We will move the icon to be the first field in the grid. We will remove the floating decimal numbers on the ID field. We&amp;rsquo;ll format the Price number field as currency. And finally we&amp;rsquo;ll assign the XamColorPicker element to be the editor for the ColorKey field. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To override how the fields are generated we will need to disable the XamDataGrid AutoGenerateFields feature. This property is located in the FieldLayoutSettings property on the data grid. In the properties panel locate FieldLayoutSettings (should be in the Behavior category). Clicking on the New button next to this property will add an instance of this property which we can customize. Blend will expand to show the properties in FieldLayoutSettings. Here locate and check off the AutoGenerateFields property.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image13.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Next we will need to add a custom FieldLayout which will define how each field will appear in the XamDataGrid. In Properties locate the FieldLayouts (Collection) property (which should be in the Miscellaneous category).&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Clicking on the button with the ellipse will display a dialog which will prompt us to add an instance of a FieldLayout.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image14.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the FieldLayout Collection Editor dialog add on instance of a FieldLayout.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image15.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the properties for the added FieldLayout you will find a Fields Collection property. Click on the Fields Collection button to bring up the Field Collection Editor dialog. Here we will be adding a Field for each property in our data source.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Clicking on the &amp;lsquo;Add Another Item&amp;rsquo; button will invoke the Select Object dialog. Here you can choose between adding a Field or an Unbound Field. As the name implies Unbound Fields are for adding Fields that are not derived from a property from the data source directly.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image16.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Add a Field object.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;A Field will show up in the Field Collection Editor dialog with properties for that Field appearing on the right of the dialog. Here is where we can make the first field point to the Icon property. To do this we must assign the Field Name property to match the name of the property from the bound data. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Type the work &amp;lsquo;Icon&amp;rsquo; in the Name field.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;We don&amp;rsquo;t need a Label for the icon image, so type a space in the Label field.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Finally, to limit the width and height of the icon, type 30 in both Width and Height fields.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image17.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To add and customize the next field, we will need to &amp;ldquo;add another item&amp;rdquo; to the Field Collection Editor. If you hit the OK button and closed the editor, simply click on the Fields ellipse button again in the FieldLayout Collection Editor dialog.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Add a new Field.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;The next field we will assign the ProductName property to. Since ProductName needs to be separated by a space to be more human friendly, assign &amp;lsquo;ProductName&amp;rsquo; to the Field Name property and &amp;lsquo;Product Name&amp;rsquo; to the Label property. Also set the Width of this property to &amp;lsquo;160&amp;rsquo;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image18.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Add a third Field and set the following properties:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Name: &amp;lsquo;ForSale&amp;rsquo;&lt;br /&gt;Label: &amp;lsquo;For Sale&amp;rsquo;&lt;br /&gt;Width: &amp;lsquo;70&amp;rsquo;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Add a fourth Field with the following properties:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Name: &amp;lsquo;ID&amp;rsquo;&lt;br /&gt;Label: &amp;lsquo;ID&amp;rsquo;&lt;br /&gt;Width: &amp;lsquo;60&amp;rsquo;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Add a fifth Field with the following properties:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Name: &amp;lsquo;ColorKey&amp;rsquo;&lt;br /&gt;Label: &amp;lsquo;Color Key&amp;rsquo;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Finally, add the last Field with the following properties:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Name: &amp;lsquo;Price&amp;rsquo;&lt;br /&gt;Label: &amp;lsquo;Price&amp;rsquo;&lt;br /&gt;Width: &amp;lsquo;70&amp;rsquo;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Press OK on both dialogs to close them both. Build or run the project and you will see the grid update with the new field layout.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;The following is the XAML which Blend generated for us:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image19.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal;"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Editor Formatting&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To finish the formatting, we will need to add a few styles. To create styles with Expression Blend, you need to have an instance of the type of object you wish to style. This is problematic when the object you wish to style already exists in a context which Blend does not provide access to. For example, the XamDataGrid instantiates XamEditor derivations for each field type. Since the instance is implicitly assigned, Blend will not allow us to create a style for one of these editors since there is no explicit instance Blend can reference. To work around this you can either create the style in the XAML text editor or temporarily add an instance of the type of editor you wish to style, create the style for the editor, remove the temporary instance of the editor then assign the style to the XamDataGrid Field. We will do the latter.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Make sure the LayoutRoot in the Objects and Timeline panel is selected before proceeding.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In Assets search type XamNumericEditor and double-click on the editor control to add it to the Window.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;With the temporary XamNumericEditor selected in Objects and Timeline, select the &lt;b style="mso-bidi-font-weight:normal;"&gt;Object -&amp;gt; Edit Style -&amp;gt; Create Empty &lt;/b&gt;menu item from the top menu bar.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image20.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the subsequent Create Style Resource dialog name the style &amp;lsquo;NumericEditorIDStyle&amp;rsquo; and make sure to add it to the current document.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image21.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Blend will place the designer into Style editing mode. In this mode, any change to a property will become a Setter in the current style. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To format the XamNumericEditor to not show numbers after the decimal point, we will want to assign a mask to the Mask property.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Type &amp;lsquo;nnnnn&amp;rsquo; in the Mask property.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Click on the Return Scope button to exit Style editing mode.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image22.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Now that we have our style, we don&amp;rsquo;t need the XamNumericEditor. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Delete the XamNumericEditor element in the Objects and Timeline panel.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;However, we have the style which was added to the Resource Dictionary of the Window.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image23.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To apply the style, we will need to assign it to the Field.Settings.EditorStyle property for the ID field.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To return to this editor, click on the XamDataGrid FieldLayouts (Collection) property ellipse button, click on the Fields (Collection) ellipse button in the FieldLayout Collection Editor dialog, select the fourth Field in the Field Collection Editor dialog, and click on the New button next to the Setting property for the ID field.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Settings will expand to show additional settings properties for that field. Locate the EditorStyle property. In the Advanced Options for EditorStyle, the Local Resources option is disabled (with this version, this may be fixed in a future version), so instead we will add a custom expression.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image24.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the Custom Expression popup dialog add the following text:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;{StaticResource NumericEditorIDStyle}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;This should apply the formatting to the ID field immediately. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To apply currency formatting to the Price field, we simply need to change the Editor Type from XamNumericEditor to XamCurrencyEditor. This change will be made in similar fashion as the ID field except we will not need a style. Before we can do this, we will need a reference to the mscorlib assembly namespace.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;The following instruction is the only instruction where you must switch to the XAML editor.&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;Add the following text to the Window tag in the XAML editor:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Consolas;color:red;font-size:9.5pt;"&gt;xmlns&lt;/span&gt;&lt;span style="font-family:Consolas;color:blue;font-size:9.5pt;"&gt;:&lt;/span&gt;&lt;span style="font-family:Consolas;color:red;font-size:9.5pt;"&gt;sys&lt;/span&gt;&lt;span style="font-family:Consolas;color:blue;font-size:9.5pt;"&gt;=&amp;quot;clr-namespace:System;assembly=mscorlib&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;As you might imagine, I now have two feature requests for Expression Blend: the ability to add references to namespaces and the ability to add a Style to any type of object.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Return to the design editor, and open the Price Field properties by returning the the XamDataGrid FieldLayouts, Fields dialogs. The last Field is the Price Field. Click on the New button for Settings.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image25.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the Settings properties locate EditAsType and in its Advanced Options add the following text to the Custom Expression option:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;{x:Type sys:Decimal}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image26.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Finally, add the following custom expression to the advanced options for the property EditorType:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;{x:Type igEditors:XamCurrencyEditor}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;The following XAML will be generated from the two added custom expressions:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image27.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;On pressing OK on the two dialogs the Price field will update to display current locale formatted currency.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal;"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;CellValuePresenter DataTemplate Override&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;The final change we will make to customize the formatting for the grid is the ColorKey field. Here we will create a CellValuePresenter Style which will contain a DataTemplate definition. The DataTemplate will bind the ColorKey value to the SelectedColor property on the XamColorPicker control.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;If you refer to Infragistics documentation for creating a CellValuePresenter Style you will find various XAML examples. Once again, this is another scenario where Blend cannot create this style from scratch without a little help as the CellValuePresenter is another object which is created behind the scenes for every field. The CellValuePresenter defines how the value for each cell is presented within the UI of the XamDataGrid Record. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Additionally, since the XamDataGrid will always instantiate instances of this control, this element is not added to the XML that Blend reads to know what to display in Assets. To work around these few Blend limitations, we will briefly return to the XAML editor one last time.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the XAML editor, add the following text to the LayoutRoot content (before or after the XamDataGrid block of XAML).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&amp;lt;igDP:CellValuePresenter/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;On returning to the designer a CellValuePresenter will appear in the Objects and Timeline. Now we have an object that we can style.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image28.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Select the CellValuePresenter, then in the Object menu on the top menu bar select the &amp;lsquo;Edit Style&amp;rsquo; -&amp;gt; &amp;lsquo;Create Empty&amp;rsquo; option. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Name the style &amp;lsquo;ColorKeyCellStyle&amp;rsquo; in the Create Style Resource dialog.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image29.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To assign a non XamEditor control to the cell value presenter, we will need to create a DataTemplate which hooks up this control. In the Style editor the breadcrumb control at the top of the designer allocates a menu for doing just that.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;At the top of the designer a control will show a palette menu next to the CellValuePresenter label. This will show all the template editors available for this style. Select the second template editor for editing the ContentTemplate. From here create an empty template.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image30.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the Create DataTemplate Resource dialog, add the following style name: &amp;lsquo;ColorCellDataTemplate&amp;rsquo;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Blend places the designer in edit mode for the DataTemplate.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Add the XamColorPicker control from Assets to the DataTemplate Grid.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image31.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;After making sure &lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;the XamColorPicker is selected in the Objects and Timeline panel, locate the SelectedColor property from in the XamColorPicker Properties category.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Next go to the SelectedColor Advanced Options and choose the Data Binding option. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the Create Data Binding dialog, make sure Data Context tab is selected and add the following text to the &amp;lsquo;Use a custom path expression&amp;rsquo; field: &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Value&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Also make sure all Layout properties are set to default. Blend will probably set the HorizontalAlignment to Left. This will end with confusing results. So it is important that both Horizontal and Vertical alignments are set to Stretch.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Return scope to the Window layout and delete the temporary CellValuePresenter from the LayoutRoot.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To assign the style to the ColorKey field, return to FieldLayouts for the XamDataGrid and Fields for the FieldLayout.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Select the second to last Field in the Field Collection Editor dialog.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Add New Settings for the ColorKey field.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Locate the CellValuePresenterStyle property and select Advanced Options. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Advanced Options will allow us to select the ColorKeyCellStyle from the Local Resources option.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image32.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;There is one last caveat to work around. Blend always uses the DynamicResource keyword when assigning styles. You may encounter a problem with assigning a CellValuePresenter style using DynamicResource at run time. Since the style is defined locally, we can change DynamicResource to StaticResource. You can do this in the XAML or by simply choosing the Custom Expression option in Advanced Options. Since we already assigned the local resource, the Custom Expression field will show the expression. Here change DynamicResource to StaticResource.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image33.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Dismiss the open dialogs by pressing OK and run the application. You will find the XamColorPicker displaying the color in the ColorKey field. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image34.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the Data panel you can customize the sample data by adding more records. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image35.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;If you elements do not show up, then there may be a type in the XAML or a style was not assigned correctly. If elements show up but are oddly placed, then a Layout property was assigned that needs to be cleared. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;I&amp;rsquo;ve attached the project for reference.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In spite of a few of the caveats with working with custom styles with Blend, having Blend automate the generation of the XAML limits XAML typos and is useful in that XAML will display properties and event names, and provides specialized editors for working with styles and templates.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/XDGImages/Image36.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In my next killer blog I will demonstrate applying styles to override background, highlight and hover brushes for cells, header labels, and row summaries as well as how to override text styles for cells and labels.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Signature.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=245872" width="1" height="1"&gt;</content><author><name>CurtisTaylorInfragistics</name><uri>http://www.infragistics.com/profile/Nzg4OA==</uri></author><category term="WPF" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/WPF/default.aspx" /><category term="Blend 4" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Blend+4/default.aspx" /><category term="XamDataGrid" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/XamDataGrid/default.aspx" /><category term="Data Binding" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Data+Binding/default.aspx" /><category term="xamColorPicker" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamColorPicker/default.aspx" /><category term="CellValuePresenter" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/CellValuePresenter/default.aspx" /><category term="Field" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Field/default.aspx" /><category term="FieldLayout" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/FieldLayout/default.aspx" /><category term="Style" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Style/default.aspx" /></entry><entry><title>Taking Control of NetAdvantage for WPF 4</title><link rel="alternate" type="text/html" href="/community/blogs/curtis_taylor/archive/2010/07/26/taking-control-of-netadvantage-for-wpf-4.aspx" /><id>/community/blogs/curtis_taylor/archive/2010/07/26/taking-control-of-netadvantage-for-wpf-4.aspx</id><published>2010-07-27T01:48:00Z</published><updated>2010-07-27T01:48:00Z</updated><content type="html">&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/ControlMonster2.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;br /&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;"&gt;I&amp;rsquo;ve been busy getting acquainted with some of our new WPF controls. They are completely fantastic! With version 2010.2 comes the release of new controls that require WPF 4.0. This blog will talk a little about some changes concerning these controls.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image000.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;NetAdvantage for WPF has some awesome new 4.0 features and controls. The new controls include the following:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The new xamColorPicker which can be customized to include your own color palettes.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image001.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The xamDialogWindow which can be styled to create simple stylish MessageBoxes or complex modal dialogs&amp;nbsp;with various presentation options.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image002.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The xamMenu and xamContextMenu provide a complete solution for managing a complete menu bar and contextual menus.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image003.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The xamSlider provides the means for creating sliders with multiple thumbs as well as presenting various types of data including the Date and Time.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image004.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The xamSpellChecker provides a simple Spell Checking solution to your applications.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image005.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;With the xamTagCloud you can add&amp;nbsp;the popular Web Control for displaying hyperlink buttons with a visual indicator to communicate the weight of the number of times the tag is used.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image006.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;In addition to these we now have NetAdvantage Data Visualization for WPF. This suite of controls includes the following dynamic controls.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The xamGuage provides a creative way to present a visual indicator for dynamic data.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image007.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The xamTimeline positions information along a timeline which a user can explore in detail and zoom in details.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image008.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The xamBulletGraph extends the bar graph and guage to provide comparitive and qualitative ranges of data.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image009.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The xamDataChart is a chart control designed to handle millions of data points with fast performance.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image010.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The xamPivotGrid is a specialized data grid for working with multidimensional data (MDX) from OLAP cubes, data warehouses and Microsoft&amp;reg; SQL Server&amp;reg; Analysis Services.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image011.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The xamBarcode manages the details of barcode imaging, allowing you to easily embed data in barcode format.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image012.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The &lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;xamTreemap fullfilles the standard of creating heatmaps made popular in the financial industry. These can be used for inventory management &lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;and market maps for showing hot stocks and cold sectors.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image013.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;Finally, the xamMap provides a way for presenting visual maps of data. This can be used for traditional maps of the world and countries or for anything you can represent as a map, such as a map of an interactive seating diagram.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&amp;nbsp;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image014.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;strong&gt;&lt;span style="font-size:small;"&gt;Some things I noticed with using these controls that&amp;nbsp;I would like to make you aware of...&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;The new controls in the main Client product and all the Data Visualization controls require WPF 4. This means you need to make sure the project is set up to use .NET 4.0 CLR framework. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;To do this in Expression Blend, you can specify the CLR version below the CLR Language in the New Project dialog.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image015.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;In Visual Studio 2010, the version is at the top of its New Project dialog.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image016.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;If you add these assemblies to a 3.5 project you will find odd behavior with them rendering in Blend and VisualStudio and you will experience namespace compiler errors. It may be hard to figure out at first what is going on. Simply make sure the project is set up for the 4.0 CLR.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;Finally, the other thing that is new with using these controls is the placement of the DLLs on your hard drive after installation. As usual most of the controls require at least two DLLs. For example, the xamColorPicker requires both:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Symbol;mso-no-proof:yes;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;"&gt;&lt;span style="mso-list:Ignore;"&gt;&amp;middot;&lt;span style="line-height:normal;font-variant:normal;font-style:normal;font-family:&amp;#39;Times New Roman&amp;#39;;font-weight:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;"&gt;InfragisticsWPF4.v10.2.dll&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Symbol;mso-no-proof:yes;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;"&gt;&lt;span style="mso-list:Ignore;"&gt;&amp;middot;&lt;span style="line-height:normal;font-variant:normal;font-style:normal;font-family:&amp;#39;Times New Roman&amp;#39;;font-weight:normal;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;"&gt;InfragisticsWPF4.Controls.Editors.XamColorPicker.v10.2.dll&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;Since &amp;lsquo;InfragisticsWPF4.v10.2.dll&amp;rsquo; is used by controls from both suite of controls, this and other common assebmlies are now placed into a new folder: the WPFCommon folder. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image017.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;Additionally, within the&amp;nbsp;NetAdvantage WPF folder you will find folders &amp;lsquo;CLR3.0&amp;rsquo; and &amp;lsquo;CLR4.0&amp;rsquo;. The XamColorPicker DLL can be found only in the &amp;lsquo;CLR4.0&amp;rsquo; folder since it is a .NET CLR 4.0 assembly. Keep this in mind when adding DLL references and don&amp;rsquo;t forget the common DLLs when adding these controls to your products and you will have no problem in accessing the various parts of their object models.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Wpf4Info/image018.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;To read more about the new placement for the assemblies, check out the following &lt;/span&gt;&lt;a target="_blank" href="http://help.infragistics.com/NetAdvantage/WPF/2010.2/CLR4.0/?page=WPF_Dot_Net_4_Builds.html" title="Dot Net 4 Assemblies Information"&gt;&lt;span style="font-size:small;"&gt;documentation webpage&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:small;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;In my next blog I will focus on techniques for using the xamDataGrid with Expression Blend and Visual Studio 2010. I will also be demonstrating the xamColorPicker by adding it as a field in the XamDataGrid.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Signature.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=242397" width="1" height="1"&gt;</content><author><name>CurtisTaylorInfragistics</name><uri>http://www.infragistics.com/profile/Nzg4OA==</uri></author><category term="WPF" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/WPF/default.aspx" /><category term="NetAdvantage" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/NetAdvantage/default.aspx" /><category term="xamTreemap" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamTreemap/default.aspx" /><category term="xamTimeline" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamTimeline/default.aspx" /><category term="Data Visualization" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Data+Visualization/default.aspx" /><category term="xamDataChart" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamDataChart/default.aspx" /><category term="xamColorPicker" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamColorPicker/default.aspx" /><category term="CLR4.0" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/CLR4.0/default.aspx" /><category term="xamPivotGrid" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamPivotGrid/default.aspx" /><category term="xamMap" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamMap/default.aspx" /><category term="CLR3.0" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/CLR3.0/default.aspx" /><category term=".NET 4.0" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/.NET+4.0/default.aspx" /><category term="xamDialogWindow" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamDialogWindow/default.aspx" /><category term="xamTagCloud" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamTagCloud/default.aspx" /><category term="xamBulletGraph" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamBulletGraph/default.aspx" /><category term="xamBarcode" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamBarcode/default.aspx" /><category term="xamContextMenu" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamContextMenu/default.aspx" /><category term="xamSpellChecker" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamSpellChecker/default.aspx" /><category term="xamMenu" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamMenu/default.aspx" /><category term="xamGuage" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamGuage/default.aspx" /><category term="xamSlider" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/xamSlider/default.aspx" /></entry><entry><title>Control Monster Explores Multi-Level XamTrees - Part II</title><link rel="alternate" type="text/html" href="/community/blogs/curtis_taylor/archive/2010/07/09/control-monster-explores-multi-level-xamtrees-part-ii.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="159290" href="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.23.95.06/MultiTree.zip" /><id>/community/blogs/curtis_taylor/archive/2010/07/09/control-monster-explores-multi-level-xamtrees-part-ii.aspx</id><published>2010-07-09T04:14:00Z</published><updated>2010-07-09T04:14:00Z</updated><content type="html">&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/ControlMonster2.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Hierarchical data can take on many levels and various approaches to data. To further demonstrate the flexibility and depth of the XamTree control, this blog will add a third level of data to the last example and add another XamTree which shows how to work with a recursive tree. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;
&lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal;"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Adding the Next Level to the Hierarchy&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;First, I will be working with the sample project from the &lt;a target="_blank" href="http://blogs.infragistics.com/blogs/curtis_taylor/archive/2010/06/23/control-monster-explores-multi-level-xamtrees-part-i.aspx" title="Control Monster Explores Multi-Level XamTrees - Part I"&gt;last blog&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image01.png" border="0" style="max-width:550px;" alt="" /&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To add a third level of data to the sample data, you can access the built-in features in Expression Blend. In the Data tab locate the Branches data and select the drop down menu to its right. Select the &amp;lsquo;Add Collection Property&amp;rsquo; option.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image02.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Rename the Collection Employees and select the &amp;lsquo;Add simply property&amp;rsquo; button, which has the Plus icon to the left of the drop down.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image03.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Rename the new property &amp;lsquo;Name&amp;rsquo; and make it a Name formatted String property.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image04.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Next we need to add the template for this third level of the hierarchy.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;We will need a third DataTemplate for the Employees level. To add a third DataTemplate to the project, go to the Resources tab, select the FranchiseDataTemplate in MainPage.xaml UserControl, and duplicate this style by right-clicking to Copy and right-click to Paste.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image05.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Select the duplicate item and click on the title to rename it. Rename the data template &amp;lsquo;EmployeesDataTemplate&amp;rsquo;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image06.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Click on the round rectangle or the contextual Edit menu to edit this DataTemplate.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;The duplicated DataTemplate already has a TextBlock. We need to bind the Text property of this TextBlock to the Name property. Select the TextBlock in the &amp;lsquo;Objects and Timeline&amp;rsquo; panel and locate the Advanced Options drop down and choose the &amp;lsquo;Data Binding&amp;rsquo; option.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image07.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Change the &amp;lsquo;custom path expression&amp;rsquo; to read simply as &amp;lsquo;Name&amp;rsquo;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image08.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Press OK to make the change and close the dialog. Now customize the DataTemplate as you wish. I added another TextBlock before the Name to serve as a label &amp;ldquo;Employee:&amp;rdquo;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;When complete, exit the DataTemplate editor. And select the XamTree in the Objects and Timeline panel.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image09.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the Properties panel, expand the HierarchicalItemTemplate to reveal the properties already set. The HierarchicalItemTemplate property is a HierarchicalDataTemplate. This template specifies how to apply data to the the item (with the Template property) and its children (using the ItemTemplate property). The HierarchicalDataTemplate also contains a HierarchicalItemTemplate, which is a HierarchicalDataTemplate. This means you can specify hierarchical items various levels deep. When you provide a child HierarchicalItemTemplate, then this will override the Template ItemTemplate property. This means you can have an ItemTemplate or a HierarchicalItemTemplate depending on if you need to specify further levels of data that the tree can expand.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Within the expanded HierarchicalDataTemplate, reset the ItemTemplate property to clear it. Reset is one of the Advanced Options for a property.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image10.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Next click on the &amp;lsquo;New&amp;rsquo; button next to the embedded HierarchicalItemTemplate. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image11.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the newly expanded section for the HierarchicalDataTemplate, locate the ItemTemplate property. This property can be assigned a DataTemplate to assign data properties to elements to be displayed in the next level of the hierarchy. To the right of the ItemTemplate property, click on &amp;lsquo;Advanced Options&amp;rsquo; -&amp;gt; &amp;lsquo;Local Resource&amp;rsquo; -&amp;gt; &amp;lsquo;EmployeesDataTemplate&amp;rsquo;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image12.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Since we had to remove the assignment of the BranchDataTemplate on the root HierarchicalDataTemplate ItemTemplate, we need to now assign that template to the Template of the child HierarchicalItemTemplate. Click on the Template Advanced Options and select &amp;lsquo;Local Resource&amp;rsquo; -&amp;gt; &amp;lsquo;BranchDataTemplate&amp;rsquo;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image13.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Finally, we need to point the new HierarchicalDataTemplate ItemsSource to point to the collection of Employees. Click on the Advanced Options popup and select the &amp;lsquo;Data Binding&amp;rsquo; option.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the &amp;lsquo;Create Data Binding&amp;rsquo; dialog make sure the Data Context tab is selected since the data will come from the DataContext set by the Tree. Type Employees in the &amp;lsquo;Use a custom path expression&amp;rsquo; field after enabling this option. If you expand the tree in the dialog, you can find the Employees property. However, if you select it, Blend will assign a zero&amp;rsquo;th assignmnet of this field as it does not know that the XamTree will utilize the DataContext correctly as any ItemsControl would do with the ItemsSource property. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image14.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Run the project and you will now find three levels working within the XamTree.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image15.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal;"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Working with Recursive Trees&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;For this next example, we will create another XamTree and a secondary collection in the SampleDataSource to bind to. To start re-visit the Data tab and add a second collection to the SampleDataSource.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image16.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Rename the Collection to &amp;lsquo;People&amp;rsquo;. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Add a Simple property. Make it a String property that is formatted as a Name and name the property as &amp;lsquo;Title&amp;rsquo;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Next to make the collection a recursive hierarchical collection, the drop down menu to the far right of the collection has the option to convert the collection to a &amp;lsquo;Hierarchical Collection&amp;rsquo;. Go ahead and make this change.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image17.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Now add a second XamTree to the MainPage in the second column of the root Grid layout panel. Make sure the XamTree is set to auto size and stretch align vertically and horizontally.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Bind this XamTree ItemsSource to the new collection titled People. You can do this by clicking on the &amp;lsquo;Advanced Options&amp;rsquo; -&amp;gt; &amp;lsquo;Data Binding&amp;rsquo; option and selecting People in the DataContext tab of the &amp;lsquo;Create Data Binding&amp;rsquo; dialog window.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image18.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;On making this change, the design space will immediately reflect this change.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image19.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Of course, to make the list display a few levels of data and show more than the class and namespace for this item, we will need to tie in some hierarchical data templates. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Before we do that, let&amp;rsquo;s look a little closer to the data. The data icon to the right of each People collection is a button which invokes the &amp;lsquo;Edit Sample Data dialog&amp;rsquo;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image20.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the dialog you can change the data and select the number of items to be displayed in the collection.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image21.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;On examining the data Blend creates you&amp;rsquo;ll find that the data collection count is set to 0 at the fourth and fith level. Set the fourth level count to 3 and leave the fift level at 0. We will make sure our tree can display up to this level. Currently, the XamTree can only show a finite number of levels. Thus there is no way to assign one XAML DataTemplate and have it applied recursively to all levels. If this is something you need, please let us know!&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;First we need a DataTemplate that knows how to display the Title property. To make this simple, duplicate the FranchiseDataTemplate again in the Resources panel, name it TitleDataTemplate, and edit the template. The template already has a TextBlock. Bind the TextBlock Text property to the Title property using the &amp;lsquo;Custom path expression&amp;rsquo; field. Make any additional customizations to the presentation of this item while in the editor.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image22.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Dismiss the DataTemplate editor and go back to the designer for the MainPage. Select the second XamTree and add a new HierarchicalDataTemplate by clicking on the New button next to the HierarchicalItemTemplate property.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Using Advanced Options assign the custom binding expression &amp;ldquo;People&amp;rdquo; to the ItemsSource in the HierarchicalDataTemplate.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image23.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Next in Advanced Options assign the &amp;lsquo;Local Resource&amp;rsquo;, TitleDataTemplate to the Template property in the HierarchicalDataTemplate.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image24.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To assign the next level of the hierarchy, we add another new HierarchicalDataTemplate to the HierarchicalItemTemplate. Within this next level, we also apply the Binding Custom Expression &amp;lsquo;People&amp;rsquo; to the ItemsSource property and assign the Local Resource TitleDataTemplate to the Template property.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Repeat this three more times to create four levels. In the last level, assign the Local Resource TitleDataTemplate to its ItemTemplate property (instead of another HierarchicalItemTemplate). This will finish the flow of levels and allows re-using the same DataTemplate.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Run the project and you should see the DataTemplate assigned to all levels of the sample data in action.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlog2Images/Image25.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Drop me a note if you need further clarification about this. Meanwhile, I&amp;rsquo;ve included the &lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.23.95.06/MultiTree.zip"&gt;source code to the Visual Studio 2010 (Expression Blend 4) solution for this sample&lt;/a&gt; so you might try it out yourself. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;This monster loves the XamTree. It&amp;rsquo;s versatile, flexible, and thoroughly delicious. Stay tuned for the next tasty Infragistics control we play with!&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;mso-bidi-font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Signature.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=239506" width="1" height="1"&gt;</content><author><name>CurtisTaylorInfragistics</name><uri>http://www.infragistics.com/profile/Nzg4OA==</uri></author><category term="Expression Blend" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Expression+Blend/default.aspx" /><category term="Silverlight" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Silverlight/default.aspx" /><category term="Data Binding" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Data+Binding/default.aspx" /><category term="HierarchicalDataTemplate" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/HierarchicalDataTemplate/default.aspx" /><category term="XAML" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/XAML/default.aspx" /><category term="HierarchicalItemTemplate" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/HierarchicalItemTemplate/default.aspx" /><category term="XamTree" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/XamTree/default.aspx" /><category term="Visual Studio 2010" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Visual+Studio+2010/default.aspx" /></entry><entry><title>Control Monster Explores Multi-Level XamTrees - Part I</title><link rel="alternate" type="text/html" href="/community/blogs/curtis_taylor/archive/2010/06/23/control-monster-explores-multi-level-xamtrees-part-i.aspx" /><id>/community/blogs/curtis_taylor/archive/2010/06/23/control-monster-explores-multi-level-xamtrees-part-i.aspx</id><published>2010-06-23T07:00:00Z</published><updated>2010-06-23T07:00:00Z</updated><content type="html">&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/ControlMonster2.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Displaying hierarchical data in software is a strategically useful task which can get complicated fast depending on how deep the hierarchy goes. You may have a database that lists accounts for a set of users where each account contains a list of transactions. You may even have a recursive tree, such as an org chart where each team member contains a list of team members they are responsible for. A large hierarchical organization may have several levels of relationships. Abstracting that to data means each team member item would contain a collection of team member items.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="PADDING-LEFT:30px;"&gt;&lt;span style="color:red;mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image00.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color:red;mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;span style="color:#888888;"&gt;&lt;em&gt;&lt;span style="color:#000000;"&gt;The above example of the XamTree with a custom template is from the Silverlight NetAdvantage Feature Browser.&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;The Infragistics Silverlight XamTree solves this by providing a flexible model for defining n number of hierarchical data templates for each tier within the hierarchy. The API is easy to use and is basically data driven. I will show you a few technicques for applying data templates to various levels within a hierarchy. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;XamTree was formerly named XamWebTree. In our effort to consolidate the names of our WPF and Silverlight products, XamTree became the new name for this control. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;I will be creating a test application using the Silverlight control from the Silverlight NetAdvantage Web Client 2010.2. I will also be using Expression Blend version 4 and Silverlight 4. You can use the previous version of all of these tools. Just remember that in the last version the XamTree was named XamWebTree.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color:red;mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image01.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To start this sample, go ahead and create a Silverlight application using either Expression Blend or Visual Studio. Add the NetAdvantage default assembly and the XamTree assembly to the project. With NetAdvantage 2010.2, you will be adding the following two assembly DLLs located in the Program Files folder in the &lt;strong&gt;Infragistics\NetAdvantage 2010.2\SilverlightCommon\Bin&lt;/strong&gt; folder:&lt;br /&gt;&lt;em&gt;InfragisticsSL4.v10.2.dll&lt;br /&gt;InfragisticsSL4.Controls.Menus.XamTree.v10.2.dll&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color:red;mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image02.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color:red;mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Create a Grid with two Columns each with Column Width set to 1*.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color:red;mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image03.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;If you created the project in Blend, make sure that the root UserControl element does not have hard-coded Width and Height properties set. If so, set them both to Auto.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Add a XamTree to the first column. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color:red;mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image04.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;And set to stretch vertically and horizontally within the column.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color:red;mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image05.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;Next we will add sample data (see &lt;a target="_blank" href="http://forums.infragistics.com/blogs/curtis_taylor/archive/2010/06/09/getting-started-with-netadvantage-silverlight-and-wpf-adding-sample-data.aspx" title="Creating Sample Data with Expression Blend"&gt;my last blog&lt;/a&gt; for information how to use Blend to create sample data).&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;I renamed the default collection, Franchises. I renamed the first default string property StoreName. Left the string format as Lorem ipsum with the word count set to 1 and word length as 8.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="color:red;mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image06.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the drop down menu next to Franchises I add a Collection property, naming it Branches. Then I add an address formatted string property, a telephone formatted string property and an Image property to the Branches collection. You can provide a source folder for the test images or leave the Image fields blank to allow Blend apply its own test images. The Image property I&amp;rsquo;ve renamed Icon.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;a href="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image07.png"&gt;&lt;span style="font-family:Calibri;color:#0000ff;font-size:small;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image07.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Sample data in place in less than two minutes, to apply it to the XamTree, I right-click on the XamTree in the Objects and Timeline panel and locate the &amp;lsquo;Data bind ItemsSource to Data&amp;hellip;&amp;rsquo; menu item.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image08.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the Create Data Binding dialog I locate the Franchises collection in the SampleDataSource. Simply selecting this and dismissing the dialog by pressing OK will bind the sample data to the XamTree.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image09.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;At this point you should see the XamTree display a list of class names. Since the collection is more complex than a list of strings, we will want to utilize Hierarchical Data Templates to present the data.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image10.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the example, I intend to apply different DataTemplates to the Franchises collection and to the Branches child collections. To first apply a template to the parent Franchises collection, locate the breadcrumb control at the top of the design view and navigate to the following command:&lt;br /&gt;Edit Additional Templates -&amp;gt; Edit Generated Items (ItemTemplate) -&amp;gt; Create Empty&amp;hellip;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image11.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;The ItemTemplate is the default DataTemplate applied to generated items in the XamTree. It works identically to the ItemTemplate of any ListBox or other ItemsControl elements.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the &amp;lsquo;Create DataTemplate Resource&amp;rsquo; dialog I&amp;rsquo;ve named the new DataTemplate &amp;lsquo;FranchiseDataTemplate&amp;rsquo;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image12.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Blend will switch the designer to a template editor view. In this view I will add a TextBlock to the given Grid. I will then bind the Text property of the TextBlock to the StoreName property in the Franchise collection item. To do this in Blend, click on the Advanced Options popup menu in the Properties panel and choose the Data Binding option.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image13.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;This will bring up the Create Data Binding dialog. From here you can easily select the StoreName property. This adds the binding expression for you which minimizes the chance of mis-typing a word in the XAML extension brackets (which is the main convention for creating binding expressions in XAML).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image14.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;We are done with this DataTemplate. You can now easily return the design view scope back to the main UserControl interface by clicking on the Return scope button in the Objects and Timeline panel.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image15.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;You should now have the Lorem ipsum sample text appear in the XamTree control. Incidentally, Lorem ipsum is a convention in graphic design for using auto-generated placeholder text in text layouts. You can read more about it in Wikipedia:&lt;br /&gt;&lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/Lorem_ipsum"&gt;&lt;span style="font-family:Calibri;color:#0000ff;font-size:small;"&gt;http://en.wikipedia.org/wiki/Lorem_ipsum&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;You may have noticed in the Additional Templates drop down there was nothing there for secondary or tertiary levels of the tree. As you can imagine, every element in a collection can have a collection of items, which can have more collections of items. The hiararchical nature of assigning templates add a level of complexity that is solved with the HierarchicalItemTemplate property in the XamTree.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;You can locate the HierarchicalItemTemplate in the XamTree section of properties. At this point I click on the New button next to this property to instantiate one of these templates within the XamTree. On doing so, you will notice that our rudimentary DataTemplate is no longer applied. To re-apply this template, we need to tie in the template the the data source to the new HierarchicalDataTemplate which gets assigned to the HierarchicalItemTemplate property.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image16.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;The new HierarchicalDataTemplate contains an ItemsSource property. Using Advanced Options, create a new data binding to this property. Since we want to communicate the next level of the tree, we will need to bind this property to the Branches property. However, Blend is not aware of the templating nature of this binding. So if you select Branches from the DataContext tab, Blend will create an incorrect expression, &amp;ldquo;Franchises[0].Branches&amp;rdquo;. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image17.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To correct this, select the &amp;lsquo;Use a custom path expression&amp;rsquo; checkbox and strip the first part of the expression until it simply reads as &amp;lsquo;Branches&amp;rsquo;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image18.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Next click on the Advanced Options button for the Template property in the HierarchicalDataTemplate. In the &amp;lsquo;Local Resource&amp;rsquo; sub-menu the original DataTemplate will be displayed. Select this resource to re-apply this template to the parent part of the XamTree. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image19.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;After doing this you won&amp;rsquo;t see anything work yet as we will need to remove the resource assignment to the ItemTemplate property in the XamTree. To do this, find the ItemTemplate property in the Miscellaneous section and choose Reset in the Advanced Options menu. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image20.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;On doing so, the XamTree in the designer will now display the Lorem ipsum names and triangle controls for expanding the tree.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image21.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To complete this, we still need to add a DataTemplate for each Branch item. We will create a DataTemplate to present the Branch information and assign it to the ItemTemplate property in our HierarchicalDataTemplate.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;One way to do this is to duplicate the first DataTemplate and modify the duplicate. To duplicate the existing DataTemplate, switch to the Resources panel, locate the FranchiseDataTemplate in the MainPage.xaml UserControl. Right-click on this resource and choose Copy, then right-click on the UserControl and choose Paste. Next click on the duplicate resource label to select it. Rename it BranchDataTemplate.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image22.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To the right of the new resource, click on the rounded rectangle to enter editing mode for this resource.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image23.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;In the DataTemplate editor, change the Grid layout to display two rows and two columns. Set the first column Width to Auto and the Height for boths rows to Auto. Leave the second column Width as 1*.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Add an Image element to the first column spanning both rows. Center this Image vertically and horizontally and set its Width and Height to 40. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Set the existing TextBlock to be in column 1 and row 0. Add a second TextBlock to column 1 and row 1.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;There are a couple of ways to assign Rows and Columns to a Grid. If you have not done this before, simply locate the ColumnDefinitions and RowDefinitions properties in the expanded Layout section of the Properties panel. There is a button that will take you to an editor dialog for these properties.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Since we do not have a current DataContext to work with, this is one of the few times we would be working blind with a template editor. So somethings to look for:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Make sure the Grid and the two TextBlock Layout Width, Height, VerticalAlignment, HorizontalAlignment and Margin properties are all clear of any values. You should Reset these properties if Blend added any setting to these. When working with items in the designer, Blend will change these settings. Also make sure that the Row, Column, RowSpan, and ColumnSpan are set up to support the Image taking up the two rows in the first column and the two TextBlocks taking the first and second rows in the second column.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;To make sure the layout is correct, you can assign temporary text and an image Source to the Image. This will help you make sure your layout is good. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image24.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Bind the first TextBlock Text property to the custom path expression &amp;ldquo;Address&amp;rdquo; (assuming that is the name you used for your Address field). Make sure you do this with DataContext selected in the tabs and not Data Field. If Data Field is selected, it will create a new connection to the sample data. We need to use the data that is already coming through the data context of the data that is already assigned to the XamTree ItemsSource.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;a href="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image25.png"&gt;&lt;span style="font-family:Calibri;color:#0000ff;font-size:small;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image25.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Do the same for the second TextBlock Text property assigning it the custom expression &amp;ldquo;Phone&amp;rdquo; (which is the name I used for my Branch Telephone property).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Finally, bind the Image Source property to the custom path expression &amp;ldquo;Icon&amp;rdquo; (which is the property name I used in sample data for the Image property).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;a href="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image25.png"&gt;&lt;span style="font-family:Calibri;color:#0000ff;font-size:small;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image26.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Return scope to the UserControl. Finally, we will need to assign the last DataTemplate to the HierarchicalDataTemplate. In the HierarchicalItemTemplate locate the ItemTemplate property. In the Advanced Options for this property choose the new BranchDataTemplate in the &amp;lsquo;Local Resources&amp;rsquo; sub-menu.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;Run the project and expand the tree. You will find the XamTree utilizing DataTemplates for both parent and child items. To go onto a third tier of data, the HierarchicalDataTemplate contains its own HierarchicalItemTemplate property. You would use this in the same way we used it for the relationship between level 1 and 2. You could assign a ItemTemplate to the third tier hierarchy of data and specify which property goes to the ItemsSource of the next tier. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/TreeBlogImages/image27.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;What if you have a Tree that is like a linked list, a recursive tree, where one of the properties in the tree item is a list of the tree items of the same class as the parent. In part 2 I will explore some of the techniques you can use&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;with this scenario. I will also show how you can bind a Boolean property in your data to the IsChecked and the IsSelected properties in the XamTreeItem.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Signature.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=237066" width="1" height="1"&gt;</content><author><name>CurtisTaylorInfragistics</name><uri>http://www.infragistics.com/profile/Nzg4OA==</uri></author><category term="Expression Blend" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Expression+Blend/default.aspx" /><category term="Silverlight" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Silverlight/default.aspx" /><category term="Sample Data" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Sample+Data/default.aspx" /><category term="Data Binding" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Data+Binding/default.aspx" /><category term="HierarchicalDataTemplate" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/HierarchicalDataTemplate/default.aspx" /><category term="XAML" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/XAML/default.aspx" /><category term="Control Monster" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Control+Monster/default.aspx" /><category term="HierarchicalItemTemplate" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/HierarchicalItemTemplate/default.aspx" /><category term="DataTemplate" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/DataTemplate/default.aspx" /><category term="XamWebTree" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/XamWebTree/default.aspx" /><category term="XamTree" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/XamTree/default.aspx" /><category term="Silverlight 4" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Silverlight+4/default.aspx" /></entry><entry><title>Getting Started with NetAdvantage Silverlight and WPF: Adding Sample Data</title><link rel="alternate" type="text/html" href="/community/blogs/curtis_taylor/archive/2010/06/09/getting-started-with-netadvantage-silverlight-and-wpf-adding-sample-data.aspx" /><id>/community/blogs/curtis_taylor/archive/2010/06/09/getting-started-with-netadvantage-silverlight-and-wpf-adding-sample-data.aspx</id><published>2010-06-09T07:19:00Z</published><updated>2010-06-09T07:19:00Z</updated><content type="html">&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;strong&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/ControlMonster2.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;strong&gt;As we go through the various most-excellent controls in our Silverlight and WPF versions of NetAdvantage&lt;/strong&gt;, we will be creating diverse sample projects with many different scenarios of sample data. To expedite the creation of sample data, I will be creating fast mock data using Expression Blend 4. The following blog will show you how I create sample data for both WPF and Silverlight projects. I will walk you through creating a test WPF application. However, Silverlight fans can do everything I will be doing with this blog using Silverlight. The blogs will switch back and forth between Silverlight and WPF, pointing out the differences and the efficient similarities. &lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;padding-left:30px;"&gt;&lt;span style="mso-no-proof:yes;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/image00.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;strong&gt;&lt;span style="font-size:medium;"&gt;Expression Blend is Photoshop for Developers.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;I once developed plugins for Photoshop and InDesign. I love Photoshop. Its features range from rudimentary to Mensa. Thus when I first started using the product, I found I could do a lot with little knowledge of the real power of the tools. However, it wasn&amp;rsquo;t until I learned the various sophisticated editors in the product that I became a force to be reckon with. Blend is a lot like that. You can open the product and move elements around and add some nice gradients fast. However, as a developer I use Blend across the board for everything &amp;ndash; from layout, to template editing, pixel perfect translation of designs, animation transition design, icon creation, customization of existing controls, creating new controls, and creating all kinds of binding expressions. Blend is a most excellent refactoring tool for XAML. From UserControls to Resources, XAML generation and refactoring happen fast in Blend. Don&amp;rsquo;t get me wrong, I also love Visual Studio, especially 2010. All of my product management and coding happen in Visual Studio. I also maintain my XAML and use both tools for both tasks. It depends. If I have to type, I skip Blend and only use Visual Studio. If I want to generate XAML fast, I use Blend. Of course, with 2010, you can generate XAML like you never could with previous versions of Visual Studio. &lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;If you don&amp;rsquo;t own a copy of Blend, you can download a 60 day demo from the &lt;a target="_blank" href="http://expression.microsoft.com/" title="Expression Website"&gt;Microsoft Expression website&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;To start with this sample, I create a new project in Blend.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/image01.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;And I usually start with the data. The data usually defines and even drives the application. Following the MVVM pattern, the ViewModel is also created based on the data. In Blend there is a Data tab. This panel contains editors for creating data, making the data be activated only at design-time, and the means for hooking up existing data sources. I click on the first popup menu to create sample data. &lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/image02.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/image03.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/image04.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;Blend starts you off with a class called SampleDataSource that contains a class derived from ObservableCollection called Collection. This will contain a list of items with a couple of generic properties. Click on the item in the data tree to rename the class name and the properties names. Click on the arrows to the right of the properties to change the type of data. Click on the Plus icon to add properties.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/image05.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;Click on the drop down arrow next to the plus icon to add a Collection item. This menu contains the following types of data: a Complex property, which is simply a new class that you can add properties to, a collection item (an embedded collection, perfect for hierarchical data). You can also convert the class to a Hierarchical Collection. This simply adds a collection of the same type to each item, thus creating a true tree pattern. &lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/image06.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;So in my sample, I renamed the Collection to TeamCollection. I have a string property called Name, a Boolean called Current, and a Number named ID. I then added a Collection item to Team Collection. I named this &amp;lsquo;Players&amp;rsquo; and added properties for name, phone number, address, email address, and more. When you change the type to String, the Format contains items like Email Address, Website and many other options. If you choose Number you can define the type of number. You can even specify image and Blend will add sample images to your project or you can point the sample data to your own directory of images. Blend will generate sample data for all the objects and properties you created. You can dedicate this data only for design time rendering, manual and unit testing or you can use it as a base for real data that you take ownership of. If you take ownership of the data, I suggest you disconnect it from Blend by refactoring the classes into your own namespace. Blend places the data into a dedicated folder into the namespace: Expression.Blend.SampleData.SampleDataSource. &lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/image07.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;You can also edit the sample data values. The data button next to the collection opens the Edit Sample Values dialog. Here you can edit the data and change the number of auto-generated records. You can also simply open the generated XAML file and modify the data there.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/image08.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;strong&gt;&lt;span style="font-size:medium;"&gt;Data Binding to NetAdvantage&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;The easiest way to see all the data in action is to tie it into an Infragistics Grid. If you are using WPF, we will add the XamDataGrid. If Silverlight, the XamWebGrid.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;To do this, add a reference to all or just the relevant DLLs for the NetAdvantage product. If you are new to the product, for now simply add all of them.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/image09.png" border="0" style="max-width:550px;" alt="" /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/image10.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;After adding the DLLs, locate the XamDataGrid (or XamWebGrid) in the Assets panel.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/image11.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;Double-click or drag the XamDataGrid item from Assets into the design space.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;Blend will have set a few Layout properties. Reset all these properties back to defaults (Auto Width and Height, Horizontal and Vertical Alignment set to Stretch and all Margins set to 0).&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/image12.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;Finally, locate the DataSource property. If using the XamWebGrid, you will locate the ItemsSource property.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/image13.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;Click on the Advanced Options button and choose the Data Binding item.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/image14.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;The Create Data Binding dialog will open. In this dialog we want to select the TeamCollection property in the SampleDataSource. This will be in the Data Field section since we used Blend to add the data. If we were to hook up our ViewModel to a DataContext in XAML, then we would be looking in the Data Context tab. The Element Property tab lets us bind to other elements in the XAML view. &lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/image15.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;Close the dialog, run the project and you should have a grid full of data. Expand the hierarchical checkbox and view the hierarchical data as well.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/BlendData/imageFinal.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;So now you have a primer you can refer to for generating sample data. This will prove highly useful for creating prototypes, quickly generating data for samples and starting you off with data for your ViewModels. SketchFlow also contains this same feature for creating prototypes. I will refer to this trick for future blogs.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin:0in 0in 10pt;"&gt;&lt;span style="font-family:Calibri;font-size:small;"&gt;Until next time, happy coding!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Signature.png" border="0" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=234496" width="1" height="1"&gt;</content><author><name>CurtisTaylorInfragistics</name><uri>http://www.infragistics.com/profile/Nzg4OA==</uri></author><category term="WPF" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/WPF/default.aspx" /><category term="Expression Blend" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Expression+Blend/default.aspx" /><category term="NetAdvantage" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/NetAdvantage/default.aspx" /><category term="Silverlight" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Silverlight/default.aspx" /><category term="Sample Data" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Sample+Data/default.aspx" /><category term="XamWebGrid" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/XamWebGrid/default.aspx" /><category term="DataSource" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/DataSource/default.aspx" /><category term="Blend 4" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Blend+4/default.aspx" /><category term="XamDataGrid" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/XamDataGrid/default.aspx" /><category term="Data Binding" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Data+Binding/default.aspx" /></entry><entry><title>Curtis Taylor is a Control Monster!</title><link rel="alternate" type="text/html" href="/community/blogs/curtis_taylor/archive/2010/06/01/curtis-taylor-is-a-control-monster.aspx" /><id>/community/blogs/curtis_taylor/archive/2010/06/01/curtis-taylor-is-a-control-monster.aspx</id><published>2010-06-01T06:36:00Z</published><updated>2010-06-01T06:36:00Z</updated><content type="html">&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/ControlMonster.png" border="0" style="max-width:551px;" alt="" /&gt;&lt;br /&gt;Yes, I admit, I have control issues! I am a programmer. I write user interfaces to help people create killer applications! I want those interfaces to give its users the maximum amount of control in producing their ideas. Monsters are wild and out of control. Oftentimes, learning how to engineer a control to do exactly what you want can feel like a monstrous job. It is my job to show you that that monster is really a&amp;nbsp;smart creative force&amp;nbsp;that wants only to show you that with a little bit of knowledge you can go a long way with the products and services Infragistics provides!&lt;/p&gt;
&lt;p&gt;For the weeks and months&amp;nbsp;to come, I&amp;#39;ve decided to write&amp;nbsp;a blog that goes into detail about the various controls Infragistics offers for Silverlight and Windows Presentation Foundation. It is my intention to teach&amp;nbsp;you about the nuances and consistent structure behind our controls. I wish&amp;nbsp;to empower you in using them to produce whatever you want. WPF and Silverlight are flexible enough&amp;nbsp;that you can create virtually any type of UI and UX idea. However, creating high-end interfaces is time-consuming and expensive. Infragistics steps in to save you&amp;nbsp;that money and time.&amp;nbsp;Infragistics controls are savvy with the technology they employ. Thus knowledge of the technology and the individual object models for each control will make your jobs easier. &lt;/p&gt;
&lt;p&gt;I have been programming user interfaces for over twelve years now. In all my career I have never found one company that not only excelled at engineering excellence, but also went the extra mile to include cutting-edge design and UX principles, intuitive and simple programming models, and top-notch services to help you resolve any issue and realize any idea you might have. With each post to this blog I hope to transmit the excitement I feel about our products, show you some tricks to using them,&amp;nbsp;and&amp;nbsp;communicate why I enjoy designing and programming with them. If you have any requests for ideas or something you would like to see, please feel free to drop me an email or leave a comment here!&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.infragistics.com/users/CurtisT/Signature.png" border="0" style="max-width:550px;border:0;" alt="" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=233011" width="1" height="1"&gt;</content><author><name>CurtisTaylorInfragistics</name><uri>http://www.infragistics.com/profile/Nzg4OA==</uri></author><category term="WPF" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/WPF/default.aspx" /><category term="Expression Blend" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Expression+Blend/default.aspx" /><category term="NetAdvantage" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/NetAdvantage/default.aspx" /><category term="GORT" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/GORT/default.aspx" /><category term="Fun" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Fun/default.aspx" /><category term="VB" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/VB/default.aspx" /><category term="C#" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/C_2300_/default.aspx" /><category term="Controls" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Controls/default.aspx" /><category term="Silverlight" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Silverlight/default.aspx" /><category term="Visual Studio" scheme="http://www.infragistics.com/community/blogs/curtis_taylor/archive/tags/Visual+Studio/default.aspx" /></entry><entry><title>WPF Panels and the Aqua Workspace Panel</title><link rel="alternate" type="text/html" href="/community/blogs/curtis_taylor/archive/2009/06/05/wpf-panels-and-the-aqua-workspace-panel.aspx" /><id>/community/blogs/curtis_taylor/archive/2009/06/05/wpf-panels-and-the-aqua-workspace-panel.aspx</id><published>2009-06-05T18:25:00Z</published><updated>2009-06-05T18:25:00Z</updated><content type="html">&lt;p&gt;One of the powerful things about Windows Presentation Foundation and Silverlight is the hierarchical presentation of user interface elements within a dynamic Panel layout. Panels are a part of WPF you don&amp;rsquo;t hear a lot about, yet are the key aspect of laying out an interface. Panels are used to automate the arrangement and even sizing of interface elements within a View. With a little design, Panels can be used to ensure localized text always fits. Panels can be used to size or anchor elements within resizable containers or windows. Panels can also be used to dynamically implement an algorithm for specific positioning and sizing of children elements.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;img border="0" src="http://dl.infragistics.com/community/wpf/media/aqua/WorkspacePanel01.jpg" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;WPF and Silverlight come with a few useful Panels. The Grid is the most versatile as it can be used to support auto-sizing of elements, a specific layout within a grid of rows and columns, and a percentage ratio for sizing. StackPanel is also useful in that it simply places elements sequentially in a horizontal or vertical stack. The days of only positioning elements using hard-coded x, y coordinates are over. However, WPF and Silverlight do still provide that ability with the Canvas Panel. Both technologies also provide a DockPanel for docking elements to sides of the Panel and a WrapPanel which adds wrapping to the StackPanel. Silverlight adds these last two Panels with its Toolbox controls library. Additionally, WPF provides a simplified Grid Panel called the UniformGrid.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;img border="0" src="http://dl.infragistics.com/community/wpf/media/aqua/WorkspacePanel02.jpg" style="max-width:550px;" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;The Panel class is a public class which any programmer can derive from to implement a custom algorithm. Infragistics takes advantage of this ability by creating various custom interfaces for customers, for the community and for internal purposes. The Panel approach is one of many ways to deliver a custom interface. As a result, WPF and Silverlight empower developers and designers to more easily create their own interfaces. And, it can often be more cost effective to utilize third party offerings of custom controls. Infragistics produces complex and highly useful interfaces to help users concentrate on other aspects of development. The Aqua Workspace Panel is an example of this. The Workspace Panel (also called Tiles Panel) will arrange elements according to a specified Grid layout. It will allow the user to size and swap items within the view. It will also present an alternate view where one item can be maximized to fill most of the panel and the rest minimized. When the container panel is resized (by resizing the window), all the elements will size accordingly. This is because the Panel abstraction provides the means for communicating and negotiating with each element to resize and re-position. The same is true for Panel drag and drop. When the user clicks and drags an element, the Panel ensures the items move within the Panel when the user &amp;ldquo;drags&amp;rdquo; and is re-positioned when the user &amp;ldquo;drops&amp;rdquo; the item into a new space in the Panel.&lt;/p&gt;
&lt;p&gt;Panels are just one of the many ways user interfaces can be customized within WPF and Silverlight. This technology also provides custom collection elements derived from ItemsControl which are used to create List Boxes, Menus, Tab Controls and Combo Boxes. Custom Control elements with Control Templates also provide the ability to create user-customizable elements which follow any paradigm you can imagine. Aqua capitalizes on the powerful features of this technology to showcase its immense potential. It is our intention, with our partnership with Microsoft, to empower our collective users, to generate enthusiasm for this technology, and to seed our community with creative, innovative and enjoyable interactive presentations for the Windows software world.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=98637" width="1" height="1"&gt;</content><author><name>CurtisTaylorInfragistics</name><uri>http://www.infragistics.com/profile/Nzg4OA==</uri></author></entry></feed>