<?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">Matev&amp;#39;s Blog</title><subtitle type="html">This blog will present advanced functionality and innovative ways to use Infragistics products in order to achieve increased developer productivity and end-user satisfaction.</subtitle><id>http://www.infragistics.com/community/blogs/kiril_matev/atom.aspx</id><link rel="alternate" type="text/html" href="http://www.infragistics.com/community/blogs/kiril_matev/default.aspx" /><link rel="self" type="application/atom+xml" href="http://www.infragistics.com/community/blogs/kiril_matev/atom.aspx" /><generator uri="http://communityserver.org" version="4.1.36.8414">Community Server</generator><updated>2011-04-12T19:57:00Z</updated><entry><title>WPF Heatmap - Switch the lights on your 2D data</title><link rel="alternate" type="text/html" href="/community/blogs/kiril_matev/archive/2013/04/30/switch-the-lights-on-with-2d-data-with-a-heatmap-control.aspx" /><id>/community/blogs/kiril_matev/archive/2013/04/30/switch-the-lights-on-with-2d-data-with-a-heatmap-control.aspx</id><published>2013-04-30T16:32:33Z</published><updated>2013-04-30T16:32:33Z</updated><content type="html">&lt;p&gt;The increasing amounts of data that users need to consume before they make a decision places increasing demands on presenting it in a way that’s easy to understand. One of the controls used to visualize 3D data is to use a heatmap. Our &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt; product contains many advanced UI data visualization controls such as a chart, map, timline, treemap, but until this point lacked a heatmap control. &lt;a href="http://www.infragistics.com/products/wpf/downloads" target="_blank"&gt;Fully-functional free 30-day trial&lt;/a&gt; of the &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt; product, which includes these controls is &lt;a href="http://www.infragistics.com/products/wpf/downloads" target="_blank"&gt;available&lt;/a&gt;. Over the last couple of months, we’ve been busy creating a heatmap control which we’d like to make available for your use and feedback. This control will not be supported before its official inclusion into the product, but already contains the functionality you need to create a rich color-coded display of your 2D data. At this time, this control is available as a CTP. &lt;/p&gt; &lt;p&gt;This blogpost illustrates the functionality of the heatmap control using a &lt;a href="http://users.infragistics.com/kmatev/blogs/heatmapApp.zip" target="_blank"&gt;sample project&lt;/a&gt;, which includes a DLL with the control itself, ready for use in your own applications. &lt;strong&gt;Please remember to &lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.Tuning+the+XamDataChart+for+Blazing-Fast+Charting/unblockZIP.jpg" target="_blank"&gt;unblock the ZIP archive&lt;/a&gt; before extracting it. &lt;/strong&gt;The project is built using Visual Studio 2010 and .NET Framework 4. The sample project contains all the libraries it needs, so you can build and run it without any additional downloads.&amp;nbsp; Here’s a screenshot of the sample project: &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/3660.image_5F00_8.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/0143.image_5F00_thumb_5F00_3.png" width="521" height="263" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;In the subsequent sections, I’ll briefly describe how to use the API and features provided by the control.&lt;/p&gt; &lt;h2&gt;How to use the sample&lt;/h2&gt; &lt;p&gt;The sample is setup with a binding to a 2D array of data, which binds to properties containing the rows, columns and objective value (to be represented by a color). &lt;/p&gt; &lt;p&gt;We’re using a linear scale for the value-to-color mapping and are using red to green color range to represent the values in the interval from 0 to 1. You can use the slider on the right to modify the width of the grid lines or press the grid button to toggle their visibility. You can smooth the heatmap values over the rows/columns by clicking the Smooth Rows and Smooth Columns buttons. &lt;/p&gt; &lt;p&gt;You can also start a timer which updates the data by clicking the Update button. In this sample, there’s also a tooltip showing the current value when an element is hovered to enable users to easily access any additional data associated with that element.&lt;/p&gt; &lt;h1&gt;API&lt;/h1&gt; &lt;p&gt;The API of this control has been designed for simplicity and completeness and also for coherence with other controls (it uses a shared color scale with other data visualization controls).&lt;/p&gt; &lt;h2&gt;Data Binding&lt;/h2&gt; &lt;p&gt;DataBinding is implemented using the standard mechanism which lets you bind to a view model through the ItemsSource property, and specify the path to the data using the ValueMemberPath property. Once you’ve bound to the data, you can set the name of the properties storing the rows and columns of the 2D data using the RowsSource and ColumnsSource properties. &lt;/p&gt; &lt;table border="0" cellspacing="0" cellpadding="2" width="642"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="200"&gt;&lt;strong&gt;Property&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="440"&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="200"&gt;ItemsSource&lt;/td&gt; &lt;td valign="top" width="440"&gt;Gets/sets the object to be used as a data source&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="200"&gt;ColumnsSource&lt;/td&gt; &lt;td valign="top" width="440"&gt;Gets/sets the System.Collections.IEnumerable for the columns&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="200"&gt;RowsSource&lt;/td&gt; &lt;td valign="top" width="440"&gt;Gets/sets the System.Collections.IEnumerable for the rows&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="200"&gt;ValueMemberPath&lt;/td&gt; &lt;td valign="top" width="440"&gt;Gets/sets the name of the property that will be represented with color&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;h2&gt;Formatting and appearance&lt;/h2&gt; &lt;p&gt;The heatmap gives you the full range of capabilities to control the axis value formatting and appearance of your data.&lt;/p&gt; &lt;table border="0" cellspacing="0" cellpadding="2" width="641"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;&lt;strong&gt;Property&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="434"&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;ColumnFormat &lt;/td&gt; &lt;td valign="top" width="434"&gt;Gets/sets the format for the column axis label formatting&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;DisplayMode &lt;/td&gt; &lt;td valign="top" width="434"&gt;Gets/sets whether value smoothing is applied across rows or columns&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;GridDisplayMode &lt;/td&gt; &lt;td valign="top" width="434"&gt;Gets/sets the grid rendering order – before and after the heatmap elements&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;ItemToolTip &lt;/td&gt; &lt;td valign="top" width="434"&gt;Gets/sets the tooltip for the hovered heatmap item&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;RowFormat &lt;/td&gt; &lt;td valign="top" width="434"&gt;Gets/sets the format for the row axis label formatting&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;h2&gt;Interaction&lt;/h2&gt; &lt;p&gt;The heatmap enables you to handle events generated by the user interacting with the heatmap elements.&lt;/p&gt; &lt;table border="0" cellspacing="0" cellpadding="2" width="641"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;&lt;strong&gt;Property&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="434"&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;ItemMouseEnter&lt;/td&gt; &lt;td valign="top" width="434"&gt;Invoked when the mouse pointer enters a heatmap element.&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;ItemMouseLeave&lt;/td&gt; &lt;td valign="top" width="434"&gt;Invoked when the mouse pointer leaves a heatmap element.&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;ItemMouseLeftButtonDown&lt;/td&gt; &lt;td valign="top" width="434"&gt;Invoked when the left mouse button is pressed in a heatmap element&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;ItemMouseLeftButtonUp &lt;/td&gt; &lt;td valign="top" width="434"&gt;Invoked when the left mouse button is released in a heatmap element&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;ItemMouseMove&lt;/td&gt; &lt;td valign="top" width="434"&gt;Invoked when the mouse pointer is moved in a heatmap element&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;These are the mouse events you can handle to provide extra information about the hovered/clicked item in a separate control. The event arguments provide the indexes of the row/column and the item represented by the heatmap item.&lt;/p&gt; &lt;h2&gt;Coloring&lt;/h2&gt; &lt;p&gt;The heatmap supports two types of value scales you can use to color the elements in the heatmap – Linear and Logarithmic. In the sample, we’re using the linear one. You’d typically use the Linear one when you don’t have a lot of variance between the values represented by the color, and the Logarithmic one when you do. The scales used for the coloring work just like chart axes with auto-ranging across multiple series or controls and with separately settable Minimum and Maximum values. &lt;/p&gt; &lt;p&gt;While at least two colors are required, more can be used. You can use this color scheme to build a choropleth view of your data. By having full control over the color scheme, you can easily implement sequential and diverging scales to adequately color your data – in the case of a diverging color scale, you’ll need to specify at least three colors.&amp;nbsp; &lt;p&gt;Both of these value scales have the following properties:&lt;/p&gt; &lt;table border="0" cellspacing="0" cellpadding="2" width="641"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;&lt;strong&gt;Property&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="434"&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;Colors&lt;/td&gt; &lt;td valign="top" width="434"&gt;Gets/sets the colors for the brushes to be used in the interval to color the elements&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;MaximumValue&lt;/td&gt; &lt;td valign="top" width="434"&gt;Gets/sets the maximum value for the color value range &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;MinimumValue&lt;/td&gt; &lt;td valign="top" width="434"&gt;Gets/sets the minimum value for the color value range &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;ActualMaximumValue&lt;/td&gt; &lt;td valign="top" width="434"&gt;Gets/sets the actual maximum value for the color value range&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;ActualMinimumValue&lt;/td&gt; &lt;td valign="top" width="434"&gt;Gets/sets the actual minimum value for the color value range&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;h1&gt;Disclaimer&lt;/h1&gt; &lt;p&gt;The control is freely available as a CTP for the time being, and can be used without limitations in your commercial projects. It will be added to our paid for product at a later stage, and from that point on will be serviced and supported. &lt;/p&gt; &lt;h1&gt;Summary&lt;/h1&gt; &lt;p&gt;This blogpost described the functionality and API of a freely available WPF heatmap control. This control can help you visualize 2D data in an easily understandable way, and can also serve as a navigation control, allowing users to quickly identify important pieces of data and act on it. In addition to facilitating navigation, it can also help you reduce clutter in your application’s layout and replace sophisticated hierarchical grid controls showing the same data. This being said, please take a look at the data presented in your application, and identify data which is three dimensional, with one of the dimensions being a number, and the other two being discrete values. Also, talk to your users about the availability of a heatmap control – they’re sure to have ideas on data to visualize with it. &lt;/p&gt; &lt;p&gt;Please send me an email if you have any questions – &lt;a href="mailto:kmatev@infragistics.com"&gt;kmatev@infragistics.com&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=402172" width="1" height="1"&gt;</content><author><name>kmatev</name><uri>http://www.infragistics.com/profile/MzAzNzk=</uri></author></entry><entry><title>Webinar: Optimizing WPF and XamDataGrid Performance</title><link rel="alternate" type="text/html" href="/community/blogs/kiril_matev/archive/2013/03/29/webinar-optimizing-wpf-and-xamdatagrid-performance.aspx" /><id>/community/blogs/kiril_matev/archive/2013/03/29/webinar-optimizing-wpf-and-xamdatagrid-performance.aspx</id><published>2013-03-29T11:55:29Z</published><updated>2013-03-29T11:55:29Z</updated><content type="html">&lt;p&gt;Overwhelmingly, WPF has been the platform of choice for desktop applications over the course of the last couple of years. It enables developers to quickly build flexible desktop applications which can be easily customized and styled. However, due to the fact that the platform enables customization on such a granular level, very often such extensive customization starts having a negative impact on performance. In this webinar I described the major points to keep in mind to ensure a high level of performance. &lt;/p&gt; &lt;p&gt;As the grid control is the mainstay of the vast majority of applications, I covered the API and approaches you can use to improve the performance of the grid control we provide as part of the &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt; product - &lt;a href="http://www.infragistics.com/products/wpf/data-grid" target="_blank"&gt;XamDataGrid&lt;/a&gt;. The &lt;a href="http://www.infragistics.com/products/wpf/data-grid" target="_blank"&gt;XamDataGrid&lt;/a&gt; is the fastest fully-featured WPF grid control on the market, and our customers are using it to handle the full range of scenarios from the most visually customized to the high-performance real-time data displays. The webinar will illustrate how to improve the performance of WPF applications in general, and how to specifically improve sorting/filtering, scrolling and startup times of views using the XamDataGrid.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;You can watch the full webinar &lt;a href="http://youtu.be/dRvXsQROmQE?t=29s" target="_blank"&gt;here&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;You can find the slides for this webinar &lt;a href="http://users.infragistics.com/kmatev/blogs/XAMLPerformanceLessons.pdf" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;You can download the samples I used during the webinar here:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;External operations blogpost + demo - &lt;a href="http://bit.ly/QNPmUF" target="_blank"&gt;http://bit.ly/QNPmUF&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Simplified templates blogpost + demo - &lt;a href="http://bit.ly/LIo6Wh" target="_blank"&gt;http://bit.ly/LIo6Wh&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Sorting update blogpost + demo - &lt;a href="http://bit.ly/SPxk6s" target="_blank"&gt;http://bit.ly/SPxk6s&lt;/a&gt;&lt;/li&gt; &lt;li&gt;Preloading blogpost + demo - &lt;a href="http://bit.ly/14sjLEm" target="_blank"&gt;http://bit.ly/14sjLEm&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Using WPF and &lt;a href="http://www.infragistics.com/products/wpf/data-grid" target="_blank"&gt;XamDataGrid&lt;/a&gt; in high-performance settings requires customizations which are covered in the blog posts above and in the webinar. You can now reach out to your users to find the key areas in need of improvement and use this guidance to improve the performance of your application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=398381" width="1" height="1"&gt;</content><author><name>kmatev</name><uri>http://www.infragistics.com/profile/MzAzNzk=</uri></author></entry><entry><title>By popular request–A Dark Theme for the WPF XamDataGrid</title><link rel="alternate" type="text/html" href="/community/blogs/kiril_matev/archive/2013/02/26/by-popular-request-a-dark-theme-for-the-wpf-xamdatagrid.aspx" /><id>/community/blogs/kiril_matev/archive/2013/02/26/by-popular-request-a-dark-theme-for-the-wpf-xamdatagrid.aspx</id><published>2013-02-26T09:55:00Z</published><updated>2013-02-26T09:55:00Z</updated><content type="html">&lt;p&gt;There has been quite a bit of interest in dark themes recently. This is because more users are finding the white background of applications straining their eyes, especially when they are spending a lot of time in front of the computer screen. The convenience of having a darker theme was also recognized by Microsoft in Visual Studio 2012, which comes with such a dark theme built-in. We have received a number of requests for dark themes for our &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt; controls, and until now, we could only advise on how customers could build such a dark theme by themselves. We&amp;rsquo;ve now been able to build such a dark theme for select WPF controls and are happy to provide it freely.&lt;/p&gt;
&lt;p&gt;We decided to start the theming work with the most-often used Infragistics control in WPF line of business applications - the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; (a part of &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt;) - a high-performance, fully-featured, richly stylable control. This blogpost features a dark theme for the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; and editor controls, which can readily be extracted and used to produce a UI that&amp;rsquo;s easy on the eyes.&lt;/p&gt;
&lt;p&gt;Please download the &lt;a href="http://users.infragistics.com/kmatev/blogs/MetroThemeDarkXamDataGrid.zip" target="_blank"&gt;sample project&lt;/a&gt; &amp;ndash; it integrates the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; with a &lt;a href="http://www.infragistics.com/products/wpf/formula-editor/" target="_blank"&gt;XamFormulaEditor&lt;/a&gt; and includes the dark theme for these two controls. &lt;strong&gt;Please remember to &lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.Tuning+the+XamDataChart+for+Blazing-Fast+Charting/unblockZIP.jpg"&gt;unblock the ZIP archive&lt;/a&gt; before extracting it. &lt;/strong&gt;The project is built using Visual Studio 2010 and .NET Framework 4. It uses the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; in the the 12.2 &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt; product, so you can build and run it without any additional downloads. &lt;a href="http://www.infragistics.com/products/wpf/downloads" target="_blank"&gt;Fully-functional free 30-day trial&lt;/a&gt; of the &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt; product, which includes the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; is &lt;a href="http://www.infragistics.com/products/wpf/downloads" target="_blank"&gt;available&lt;/a&gt;. Here&amp;rsquo;s a screenshot of the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; themed in the dark theme:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/5811.image_5F00_2.png"&gt;&lt;img style="background-image:none;padding-left:0px;padding-right:0px;display:inline;padding-top:0px;border:0px;" title="image" border="0" alt="image" src="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/7450.image_5F00_thumb.png" width="619" height="465" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;How to access the theme&lt;/h2&gt;
&lt;p&gt;The &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; Metro Dark theme is in DataPresenter_MetroDark.xaml and Editors_MetroDark.xaml files. As part of this, we&amp;rsquo;re also making available dark styles for XamFormulaEditor - in DataTree_MetroDark.xaml and FormulaEditor_MetroDark.xaml. These contain both the control templates, and the brushes and colors used to style these controls.&lt;/p&gt;
&lt;h2&gt;Modifying the theme&lt;/h2&gt;
&lt;p&gt;You can modify the colors of the brushes directly in the DataPresenter_MetroDark.xaml and Editors_MetroDark.xaml. While this approach may work for a few brush settings, if you&amp;rsquo;d like to change all the colors of the theme into a particular color hue, it&amp;rsquo;s much easier to use a &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.2/CLR4.0/?page=InfragisticsWPF4.v12.2~Infragistics.Windows.Themes.ResourceWasher.html" target="_blank"&gt;ResourceWasher&lt;/a&gt;. Resource washing lets you change the colors of all brushes in the resource dictionary, thus giving you the capability to customize the visual appearance of a control, while keeping the relative shades of colors in different elements of the control. You can read more about how to use a &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.2/CLR4.0/?page=InfragisticsWPF4.v12.2~Infragistics.Windows.Themes.ResourceWasher.html" target="_blank"&gt;ResourceWasher&lt;/a&gt; &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.2/CLR4.0/?page=ResWash_Adding.html" target="_blank"&gt;here&lt;/a&gt;. This approach is illustrated in the sample.&lt;/p&gt;
&lt;p&gt;In the sample we&amp;rsquo;re using a Transparent &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.2/CLR4.0/?page=InfragisticsWPF4.v12.2~Infragistics.Windows.Themes.WashGroup~WashColor.html" target="_blank"&gt;WashColor&lt;/a&gt; on the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.2/CLR4.0/?page=InfragisticsWPF4.v12.2~Infragistics.Windows.Themes.ResourceWasher.html" target="_blank"&gt;ResourceWasher&lt;/a&gt; in the MainWindow in order to show the dark theme as it is defined in the styles. If you&amp;rsquo;d like to activate the resource washing, please change the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.2/CLR4.0/?page=InfragisticsWPF4.v12.2~Infragistics.Windows.Themes.WashGroup~WashColor.html" target="_blank"&gt;WashColor&lt;/a&gt; setting to a different color.&lt;/p&gt;
&lt;p&gt;In this case we&amp;rsquo;re washing the entire theme in a single color. Resource washing has much greater capabilities and can wash different groups of brushes in different colors if your scenario demands it. This more advanced approach is presented &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.2/CLR4.0/?page=ResWash_Using.html" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;Styling is ever more important in desktop applications, as desktop applications are competing with the interactivity and theming in mobile applications. In this blog post, we presented a dark theme for the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; and &lt;a href="http://www.infragistics.com/products/wpf/formula-editor/" target="_blank"&gt;XamFormulaEditor&lt;/a&gt;, which lets you achieve a dark look for your application. You can use the these styles as they are, or you can easily use them as a base for resource washing, which will let you produce a variety of color combinations to suit your applications.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=394221" width="1" height="1"&gt;</content><author><name>kmatev</name><uri>http://www.infragistics.com/profile/MzAzNzk=</uri></author><category term="WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/WPF/default.aspx" /><category term="styles" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/styles/default.aspx" /><category term="XamDataGrid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/XamDataGrid/default.aspx" /><category term="theme" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/theme/default.aspx" /><category term="NetAdvantage for WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/NetAdvantage+for+WPF/default.aspx" /></entry><entry><title>Optimizing XamDataGrid Performance Using External Data Operations</title><link rel="alternate" type="text/html" href="/community/blogs/kiril_matev/archive/2012/08/28/optimizing-xamdatagrid-performance-using-external-data-operations.aspx" /><id>/community/blogs/kiril_matev/archive/2012/08/28/optimizing-xamdatagrid-performance-using-external-data-operations.aspx</id><published>2012-08-28T08:54:00Z</published><updated>2012-08-28T08:54:00Z</updated><content type="html">&lt;p&gt;A number of line of business applications use &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; for its rich feature set, high customizability and performance. If there’s been one constant development in the use of the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; across all industries, it’s been the increasing amount of data displayed in the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt;. Traditionally, grid controls perform data operations such as sorting, filtering and grouping by themselves on the UI thread. However, with increasing data loads, developers are looking for ways to perform these operations on a separate thread, or on a different machine altogether. This is why developers have asked us to have the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; pass the arguments of these operations, and without performing this operation, to display the processed result. We’ve added this functionality in the 12.1 release, and it has enabled us to significantly improve performance when large datasets are bound to the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt;. This blog post describes how to take advantage of this functionality, and describes its implications for performance in terms of memory footprint and time it takes to perform an operation.&lt;/p&gt;
&lt;p&gt;Please download the &lt;a href="http://users.infragistics.com/kmatev/blogs/XDGExternalOps.zip" target="_self"&gt;sample project&lt;/a&gt; – it illustrates how to activate off-grid processing of data manipulations, and compares the performance of a &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; bound to the same dataset in the two cases – when internal and external operations are used. &lt;strong&gt;Please remember to &lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.Tuning+the+XamDataChart+for+Blazing-Fast+Charting/unblockZIP.jpg" target="_blank"&gt;unblock the ZIP archive&lt;/a&gt; before extracting it. &lt;/strong&gt;The project is built using Visual Studio 2010 and .NET Framework 4. It uses a trial version of the 12.1 WPF product, so you can build and run it without any additional downloads. &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;Fully-functional free 30-day trial&lt;/a&gt; of the &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt; product, which includes the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; is &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;available&lt;/a&gt;. Here’s a screenshot of the sample project:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/5327.image_5F00_2.png"&gt;&lt;img style="background-image:none;padding-left:0px;padding-right:0px;display:inline;padding-top:0px;border:0px;" title="image" border="0" alt="image" src="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/7077.image_5F00_thumb.png" width="649" height="488" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;What’s in the sample&lt;/h2&gt;
&lt;p&gt;In the sample application, there are two &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt;s side by side - the one on the left uses internal operations, and the one on the right performs these operations through the CollectionView object instead. Both grids are bound to a dataset containing 100,000 records. In order to illustrate the difference in performance due to internal or external operations, we’ll compare the performance of sorting and grouping. However, the exact same results would also apply to filtering and summary computations.&lt;/p&gt;
&lt;h2&gt;Performance implications of using internal sort/group&lt;/h2&gt;
&lt;p&gt;By default, the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; only creates record objects to represent the data items which are currently visible (as opposed to all the records in the dataset). However, when sort/group operations are performed by the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; internally, it needs to create record objects to represent all the items in the data set, so it could sort/group them. Even though UI elements are not created for all these records due to the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; UI virtualization logic, the record objects can have a substantial impact on the application’s memory footprint (as we’ll see in the performance comparison below), especially when the datasets bound to the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; are large. So how does this impact performance? The first time a user sorts/groups a grid, there is a delay during which the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; creates record objects for all the data items, and then performs the operation the user requested. This puts the entire dataset in memory in terms of record objects managed by the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt;. While this increases the memory footprint, and causes a delay the first time such an operation is executed, subsequent sort/group operations are quite fast, because the entire dataset is already in memory.&lt;/p&gt;
&lt;p&gt;Let’s see how this impacts performance. Please run the sample, and sort, or group the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt;on the left - you will see the time and memory footprint change (delta) reported above it. On my machine, when the internal operations grid is sorted for the first time, the operation takes 4.3 seconds and memory consumption increases by 40MB. Subsequent sorts take around 1 second, and memory footprint stays the same (since it’s already at its maximum – all data items are represented as record objects). Once the dataset is already fully loaded, grouping takes about 2.8 seconds, ungrouping 1.2 seconds.&lt;/p&gt;
&lt;h2&gt;Performance implications of using external sort/group&lt;/h2&gt;
&lt;p&gt;You can control how sorting, grouping, filtering and summary computations are performed using the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.FieldLayoutSettings~SortEvaluationMode.html" target="_blank"&gt;SortEvaluationMode&lt;/a&gt;, &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.FieldLayoutSettings~GroupByEvaluationMode.html" target="_blank"&gt;GroupByEvaluationMode&lt;/a&gt;, &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.FieldLayoutSettings~FilterEvaluationMode.html" target="_blank"&gt;FilterEvaluationMode&lt;/a&gt; and &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.FieldLayoutSettings~SummaryEvaluationMode.html" target="_blank"&gt;SummaryEvaluationMode&lt;/a&gt; properties. They give you the ability to to disable the internal sorting, grouping, filtering, and summary calculations, and to have those performed manually, or through the CollectionView object. This means that the grid doesn’t have to initialize record objects to represent the entire data set – instead, it relies on the backend to reorder the dataset. In the case of using the collection view (by setting the above properties to “UseCollectionView”), this requires no implementation of extra logic. However, if you have a backend server, where calculations/reordering are performed, you can use the Manual setting for the above properties. This will cause the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; to fire the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.DataPresenterBase~Sorting_EV.html" target="_blank"&gt;Sorting&lt;/a&gt;/&lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.DataPresenterBase~Grouping_EV.html" target="_blank"&gt;Grouping&lt;/a&gt;/&lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.DataPresenterBase~RecordFilterChanging_EV.html" target="_blank"&gt;RecordFilterChanging&lt;/a&gt; events, enabling you to pass these onto the backend, where the calculations are performed. The &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt;will display the reordered dataset once it’s been processed by the backend.&lt;/p&gt;
&lt;p&gt;Using the UseCollectionView and Manual settings for the sorting/grouping saves the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; the need to instantiate record objects for the entire dataset, thus keeping the memory footprint constantly low. The time component of performance is up to the backend you’re using for the processing of these operations. In this sample, in the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt;on the right, we’re using the CollectionView object for handling these operations instead of the internal logic.&lt;/p&gt;
&lt;p&gt;How about performance in this case? Please run the sample, and sort, or group the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt;on the right – the time and memory footprint change will be reported right above. When sorting and grouping is performed by the collectionView (using the UseCollectionView value for SortEvaluationMode and GroupByEvaluationMode properties), the memory footprint stays the same, and the time it takes is as follows – sorting 2.5 seconds, grouping 4.9 seconds, ungrouping 2.5 seconds. There are three points to mention here:&lt;/p&gt;
&lt;p&gt;1. The memory footprint stays constant, because no extra record objects are instantiated due to sorting/grouping&lt;/p&gt;
&lt;p&gt;2. The time it takes to sort/group is constant, i.e. there’s no significant delay when performing the first sort/group (as is the case when internal operations are used, due to initializing record objects)&lt;/p&gt;
&lt;p&gt;3. Time time it takes to sort/group is greater than the time it takes to perform the same operations if internal operations are used. However the time aspect of performance is entirely up to the backend you’d like to use for these operations. Even so, using the collectionView objects gives you low-memory consumption, and good first-time sort/group performance (while in the internal operations case you have an extra delay the first time an operation is performed) and may be useful in some cases.&lt;/p&gt;
&lt;h2&gt;Summary calculations&lt;/h2&gt;
&lt;p&gt;The default internal summary calculations require the grid to initialize record objects to represent the entire dataset. Using the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.FieldLayoutSettings~SummaryEvaluationMode.html" target="_blank"&gt;SummaryEvaluationMode&lt;/a&gt; property, summary calculations can also be performed using Linq, or manually. While using Linq requires no extra implementation on your side, using the manual computation mode requires handling the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.DataPresenterBase~QuerySummaryResult_EV.html" target="_blank"&gt;QuerySummaryResult&lt;/a&gt;event, where you can perform your own evaluation logic, and provide a value for the summary result. Using the manual mode enables you to keep the memory consumption low, and gives you the opportunity to improve the calculation time as much as you can by optimizing the backend.&lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;In this blogpost, I presented how to set the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; to perform sorting/grouping/filtering/summary calculations externally. We described the API to use for this purpose, and looked into the performance implications of using external operations. The sample project can be used to easily demonstrate the difference between the two scenarios and can be readily changed to let you see the improvement in performance you’d see when you bind your own data to it. Using manual mode, you can essentially remove any limitations on sorting/grouping/filtering/summaries imposed so far by the hardware of the client machine running your application – using a powerful calculation backend machines is the best way to process large datasets efficiently, while delivering a fast and responsive UI. You can start by talking to the users of your applications, and finding out about the views where they would benefit from larger amounts of data being displayed to help them make a decision. Once you find out about those, the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; will help you meet the increasing hunger of your users for more data to be displayed, while delivering an excellent user experience. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=369787" width="1" height="1"&gt;</content><author><name>kmatev</name><uri>http://www.infragistics.com/profile/MzAzNzk=</uri></author><category term="WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/WPF/default.aspx" /><category term="Grid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Grid/default.aspx" /><category term="XamDataGrid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/XamDataGrid/default.aspx" /><category term="Performance" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Performance/default.aspx" /><category term="NetAdvantage for WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/NetAdvantage+for+WPF/default.aspx" /><category term="data binding" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/data+binding/default.aspx" /></entry><entry><title>Building Line of Business Applications using Infragistics WPF controls Webinar</title><link rel="alternate" type="text/html" href="/community/blogs/kiril_matev/archive/2012/08/24/building-line-of-business-applications-using-infragistics-wpf-controls-webinar.aspx" /><id>/community/blogs/kiril_matev/archive/2012/08/24/building-line-of-business-applications-using-infragistics-wpf-controls-webinar.aspx</id><published>2012-08-24T12:20:00Z</published><updated>2012-08-24T12:20:00Z</updated><content type="html">&lt;p&gt;Thank you for attending our webinar on August 23rd. I presented the &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt; product briefly, showed one of the showcase applications which ship as part of the &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;free trial&lt;/a&gt;, and built a simple LOB application which uses the &lt;a href="http://www.infragistics.com/products/wpf/ribbon/" target="_blank"&gt;Ribbon&lt;/a&gt;, &lt;a href="http://www.infragistics.com/products/wpf/dock-manager/" target="_blank"&gt;DockManager&lt;/a&gt;, &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;Grid&lt;/a&gt;, &lt;a href="http://www.infragistics.com/products/wpf/data-chart/" target="_blank"&gt;Chart&lt;/a&gt; and &lt;a href="http://www.infragistics.com/products/wpf/pivot-grid/" target="_blank"&gt;PivotGrid&lt;/a&gt; controls.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You can view the recording of the webinar &lt;a href="https://www149.livemeeting.com/cc/gc_pro_namewreg_infragistics/view?id=9MR8GN" target="_blank"&gt;here&lt;/a&gt;. You can download the slides &lt;a href="http://users.infragistics.com/kmatev/blogs/WPFLOBWebinar.pptx" target="_blank"&gt;here&lt;/a&gt;, and the source code of the finished application I built during the webinar &lt;a href="http://users.infragistics.com/kmatev/blogs/SampleLOBApp1.zip" target="_blank"&gt;here&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Please remember to &lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.Tuning+the+XamDataChart+for+Blazing-Fast+Charting/unblockZIP.jpg"&gt;unblock the ZIP archive&lt;/a&gt; before extracting it. &lt;/strong&gt;The project is built using Visual Studio 2010 and .NET Framework 4. It uses the 12.1 version of the &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt; product, so you can build and run it without any additional downloads. &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;Fully-functional free 30-day trial&lt;/a&gt; of the &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt; product, which includes all the controls I used is &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;available&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a screenshot of the sample application:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/6507.image_5F00_2.png"&gt;&lt;img style="background-image:none;padding-left:0px;padding-right:0px;display:inline;padding-top:0px;border:0px;" title="image" border="0" alt="image" src="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/6012.image_5F00_thumb.png" width="523" height="382" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you have any questions or comments, you can reach me at &lt;a href="mailto:kmatev@infragistics.com"&gt;kmatev@infragistics.com&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=369367" width="1" height="1"&gt;</content><author><name>kmatev</name><uri>http://www.infragistics.com/profile/MzAzNzk=</uri></author><category term="WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/WPF/default.aspx" /><category term="chart" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/chart/default.aspx" /><category term="pivot grid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/pivot+grid/default.aspx" /><category term="XamDataGrid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/XamDataGrid/default.aspx" /><category term="NetAdvantage for WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/NetAdvantage+for+WPF/default.aspx" /></entry><entry><title>Quickly visualizing column value changes in the Infragistics WPF grid</title><link rel="alternate" type="text/html" href="/community/blogs/kiril_matev/archive/2012/08/15/quickly-visualizing-column-value-changes-in-the-infragistics-wpf-grid.aspx" /><id>/community/blogs/kiril_matev/archive/2012/08/15/quickly-visualizing-column-value-changes-in-the-infragistics-wpf-grid.aspx</id><published>2012-08-15T15:06:00Z</published><updated>2012-08-15T15:06:00Z</updated><content type="html">&lt;p&gt;The vast majority line of business application rely on grids for showing record data. In your WPF applications, you can find the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; (a part of &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt;) especially useful for showing such data – it is a high-performance, fully-featured, richly stylable control. In many cases, the data you need to display is changing, showing the user an up-to-date status on a measurement value on a piece of equipment, a price on a stock, or the efficiency of an engine during a test. When a user makes a decision on whether to look more closely at a certain record in the grid, they need not only the latest value, but also the history of values to let them see the trend of the latest data. They’d like to know whether the trend is going up or down, or how often the values are outside of a given range. This is the kind of information that can only be displayed in a sparkline control. &lt;/p&gt; &lt;p&gt;This blogpost describes how you can add a &lt;a href="http://www.infragistics.com/products/wpf/sparkline/" target="_blank"&gt;XamSparkline&lt;/a&gt; control (&lt;a href="http://www.infragistics.com/products/wpf/sparkline/" target="_blank"&gt;WPF&lt;/a&gt;, &lt;a href="http://www.infragistics.com/products/silverlight/sparkline/" target="_blank"&gt;Silverlight&lt;/a&gt;) to a WPF &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; column for a quick visualization of recent changes in the column values. This same functionality is available as standard using the &lt;a href="http://www.infragistics.com/products/wpf/grid/" target="_blank"&gt;XamGrid&lt;/a&gt; (available for both WPF and Silverlight), and is shown in &lt;a href="http://www.infragistics.com/products/silverlight/sample/grid/#/sparkline-column" target="_blank"&gt;this sample&lt;/a&gt;. Please download the &lt;a href="http://users.infragistics.com/kmatev/blogs/XamDataGridSparkline.zip"&gt;sample project&lt;/a&gt; – it illustrates how to declare and bind a column to show the history of column value changes in a &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt;. &lt;strong&gt;Please remember to &lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.Tuning+the+XamDataChart+for+Blazing-Fast+Charting/unblockZIP.jpg"&gt;unblock the ZIP archive&lt;/a&gt; before extracting it. &lt;/strong&gt;The project is built using Visual Studio 2010 and .NET Framework 4. It uses a pre-release of the 12.2 WPF product, so you can build and run it without any additional downloads. &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;Fully-functional free 30-day trial&lt;/a&gt; of the &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt; product, which includes the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; is &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;available&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/1030.image_5F00_2.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/4456.image_5F00_thumb.png" width="727" height="546" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;h2&gt;Keeping track of value history&lt;/h2&gt; &lt;p&gt;You can easily enable the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; to keep track of data value changes using the approach described &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=xamDataPresenter_Enable_Data_Value_Change_Tracking.html" target="_blank"&gt;here&lt;/a&gt;. This approach uses the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.FieldSettings~DataValueChangedNotificationsActive.html" target="_blank"&gt;DataValueChangedNotificationsActive&lt;/a&gt;, &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.FieldSettings~DataValueChangedHistoryLimit.html" target="_blank"&gt;DataValueChangedHistoryLimit&lt;/a&gt;, and &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.FieldSettings~DataValueChangedScope.html" target="_blank"&gt;DataValueChangedScope&lt;/a&gt; properties. In the specific case, we’re tracking the last 15 values for columns ColumnC and ColumnD. These columns are set up as shown below:&lt;/p&gt; &lt;blockquote&gt; &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:852f71e7-6957-41bd-95c4-194b1f0e31f9" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:White;overflow:auto;"&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Style &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;x:Key&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;graphingCVPStyle&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt;
        TargetType&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color:#808000;"&gt;{x:Type igDP:CellValuePresenter}&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
    &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;Property&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;Height&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt; Value&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;25&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
    &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;Property&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;Template&amp;quot;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
        &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter.Value&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
            &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ControlTemplate &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;TargetType&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color:#808000;"&gt;{x:Type igDP:CellValuePresenter}&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Border &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;Height&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color:#808000;"&gt;{TemplateBinding Height}&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                    &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                        &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                            &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;Width&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;Auto&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                            &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;Width&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;*&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                        &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                        &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;TextBlock &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;Grid.Column&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt; VerticalAlignment&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;Center&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt;
                            Text&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color:#808000;"&gt;{Binding Value, RelativeSource={RelativeSource TemplatedParent}}&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                        &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ig:XamSparkline &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;Grid.Column&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt;
                                ItemsSource&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color:#808000;"&gt;{Binding ValueHistory, RelativeSource={RelativeSource TemplatedParent}}&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt;
                                ValueMemberPath&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;Value&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt;
                                DisplayType&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;Line&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt;
                                Width&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;80&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt;
                                LineThickness&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                    &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Border&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
            &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;ControlTemplate&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
        &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter.Value&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
    &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Style&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;p&gt;The &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.FieldSettings~DataValueChangedScope.html" target="_blank"&gt;DataValueChangedScope&lt;/a&gt; property is set to a value of AllAllocatedRecords so the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; keeps history for rows which are allocated, but aren’t currently visible. In order to have history kept for invisible records, we need to make sure the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; instantiates records to represent all the records in the data source by setting the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.DataPresenterBase~RecordLoadMode.html" target="_blank"&gt;RecordLoadMode&lt;/a&gt; property to PreloadRecords. So this creates &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; rows for the entire dataset and keeps the data value changes for each cell in the ColumnC and ColumnD columns. This approach increases the memory footprint of our sample, because we’re no longer virtualizing the UI elements of the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt;. This is why I recommend using the PreloadRecords setting for the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.DataPresenterBase~RecordLoadMode.html" target="_blank"&gt;RecordLoadMode&lt;/a&gt; for relatively small datasets. I would suggest you try to strike a balance between what the user would like to have, and the size of the memory footprint required.&lt;/p&gt;
&lt;h2&gt;Visualizing value changes with XamSparkline&lt;/h2&gt;
&lt;p&gt;We’ll now have a &lt;a href="http://www.infragistics.com/products/wpf/sparkline/" target="_blank"&gt;XamSparkline&lt;/a&gt; (available for both Silverlight and WPF) added to the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.CellValuePresenter.html" target="_blank"&gt;CellValuePresenter&lt;/a&gt; of the columns to display the value history for each cell in the ColumnC and ColumnD columns. The &lt;a href="http://www.infragistics.com/products/wpf/sparkline/" target="_blank"&gt;XamSparkline&lt;/a&gt; presents values in a small chart, where the goal is to show the values and richly format them, to give the user information about the trend and outliers, rather than a lot of interactivity (which is where a &lt;a href="http://www.infragistics.com/products/wpf/data-chart/" target="_blank"&gt;XamDataChart&lt;/a&gt; is more useful). Here’s are a few sample &lt;a href="http://www.infragistics.com/products/wpf/sparkline/" target="_blank"&gt;XamSparklines&lt;/a&gt; from our online &lt;a href="http://www.infragistics.com/products/silverlight/sparkline/" target="_blank"&gt;samples&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/3414.image_5F00_10.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/1732.image_5F00_thumb_5F00_4.png" width="244" height="138" /&gt;&lt;/a&gt;&lt;a href="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/1030.image_5F00_12.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/2425.image_5F00_thumb_5F00_5.png" width="244" height="147" /&gt;&lt;/a&gt;&lt;a href="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/6138.image_5F00_14.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/8284.image_5F00_thumb_5F00_6.png" width="244" height="137" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We’ll retemplate the cell to show the latest value next to a &lt;a href="http://www.infragistics.com/products/wpf/sparkline/" target="_blank"&gt;XamSparkline&lt;/a&gt; showing all the historic values for the cell. We’ll declare the template as shown below:&lt;/p&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:66f8a676-8579-4fbf-8d93-160b2bebe459" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:#FFFFFF;overflow:auto;"&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Style &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;x:Key&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;graphingCVPStyle&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt;
    TargetType&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color:#808000;"&gt;{x:Type igDP:CellValuePresenter}&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
    &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;Property&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;Height&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt; Value&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;25&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
    &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;Property&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;Template&amp;quot;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
        &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter.Value&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
            &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ControlTemplate &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;TargetType&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color:#808000;"&gt;{x:Type igDP:CellValuePresenter}&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Border &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;Height&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color:#808000;"&gt;{TemplateBinding Height}&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                    &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                        &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                            &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;Width&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;Auto&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                            &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;Width&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;*&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                        &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                        &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;TextBlock &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;Grid.Column&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt; VerticalAlignment&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;Center&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt;
                            Text&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color:#808000;"&gt;{Binding Value, RelativeSource={RelativeSource TemplatedParent}}&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                        &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ig:XamSparkline &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;Grid.Column&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt;
                                ItemsSource&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color:#808000;"&gt;{Binding ValueHistory, RelativeSource={RelativeSource TemplatedParent}}&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt;
                                ValueMemberPath&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;Value&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt;
                                DisplayType&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;Line&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt;
                                Width&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;80&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt;
                                LineThickness&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt; &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                    &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
                &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Border&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
            &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;ControlTemplate&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
        &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter.Value&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
    &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Style&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Please note the binding expressions for the TextBlock and &lt;a href="http://www.infragistics.com/products/wpf/sparkline/" target="_blank"&gt;XamSparkline&lt;/a&gt; controls. We’ve set a Width of 80 to comfortably show the 15 values, and we’re using a line to display the values in the &lt;a href="http://www.infragistics.com/products/wpf/sparkline/" target="_blank"&gt;XamSparkline&lt;/a&gt;, but you can set it to any of the other markers supported – area, column, WinLoss (&lt;a href="http://www.infragistics.com/products/silverlight/sample/sparkline/#/sparkline-markers" target="_blank"&gt;sample&lt;/a&gt;). You can also add &lt;a href="http://www.infragistics.com/products/silverlight/sample/sparkline/#/trendline-types" target="_blank"&gt;trendlines&lt;/a&gt;, &lt;a href="http://www.infragistics.com/products/silverlight/sample/sparkline/#/adjust-ranges" target="_blank"&gt;highlight ranges&lt;/a&gt; and &lt;a href="http://www.infragistics.com/products/silverlight/sample/sparkline/#/sparkline-tooltip" target="_blank"&gt;tooltips&lt;/a&gt;, as described in this &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=xamSparkline_Configuring_xamSparkline.html" target="_blank"&gt;walkthrough&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Having declared the template we’ll use for columns we’d like to have a sparkline in, we need to reference the style in the declarations of these columns – please note the reference to the static resource when setting the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.FieldSettings~CellValuePresenterStyle.html" target="_blank"&gt;CellValuePresenterStyle&lt;/a&gt;.&lt;/p&gt;
&lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:c406887c-fbe6-4549-895d-2934943d9f4a" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:#FFFFFF;overflow:auto;"&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;igDP:Field &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;Name&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;ColumnD&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt; Width&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;150&amp;quot;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
  &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;igDP:Field.Settings&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
      &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;igDP:FieldSettings 
        &lt;/span&gt;&lt;span style="color:#FF0000;"&gt;DataValueChangedHistoryLimit&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;15&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt; 
        DataValueChangedScope&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;AllAllocatedRecords&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt;
        CellValuePresenterStyle&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="color:#808000;"&gt;{StaticResource graphingCVPStyle}&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#FF0000;"&gt;
        DataValueChangedNotificationsActive&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;=&amp;quot;True&amp;quot;&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
  &lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;igDP:Field.Settings&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;
&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;igDP:Field&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2&gt;Summary&lt;/h2&gt;

&lt;p&gt;In this blog post I demonstrated how to setup the &lt;a href="http://www.infragistics.com/products/wpf/data-grid/" target="_blank"&gt;XamDataGrid&lt;/a&gt; to track history changes and visualize them into a &lt;a href="http://www.infragistics.com/products/wpf/sparkline/" target="_blank"&gt;XamSparkline&lt;/a&gt;. This approach can readily be used to add context to your data, and enable your users to make better decisions based on a concise and rich presentation of data. You can add this enhanced presentation to grids in your applications where a user would benefit from seeing a history of value changes. Of course, you can customize the &lt;a href="http://www.infragistics.com/products/wpf/sparkline/" target="_blank"&gt;XamSparkline&lt;/a&gt; to visualize this data in a way to properly format and display its context, so that it can be easily understood by the user.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you have any questions or comments, you can reach me at &lt;a href="mailto:kmatev@infragistics.com"&gt;kmatev@infragistics.com&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=367842" width="1" height="1"&gt;</content><author><name>kmatev</name><uri>http://www.infragistics.com/profile/MzAzNzk=</uri></author><category term="Data Visualization" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Data+Visualization/default.aspx" /><category term="Grid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Grid/default.aspx" /><category term="data analysis" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/data+analysis/default.aspx" /><category term="XamDataGrid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/XamDataGrid/default.aspx" /><category term="NetAdvantage for WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/NetAdvantage+for+WPF/default.aspx" /></entry><entry><title>XamGrid Performance Optimization Using Simplified Templates</title><link rel="alternate" type="text/html" href="/community/blogs/kiril_matev/archive/2012/08/13/xamgrid-performance-optimization-using-simplified-templates.aspx" /><id>/community/blogs/kiril_matev/archive/2012/08/13/xamgrid-performance-optimization-using-simplified-templates.aspx</id><published>2012-08-13T08:37:00Z</published><updated>2012-08-13T08:37:00Z</updated><content type="html">&lt;p&gt;The heart of the vast majority of Line of Business applications is the grid control. The &lt;a href="http://www.infragistics.com/products/wpf/grid" target="_blank"&gt;XamGrid&lt;/a&gt; is a fully-featured, high-performance, highly-customizable grid control which is available as part of our &lt;a href="http://www.infragistics.com/products/silverlight/" target="_blank"&gt;NetAdvantage for Silverlight&lt;/a&gt; and &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt; products. As the users spend a lot of their time examining lists of records, the perceived performance of an application is directly related to the performance of the grid. This blog post describes a simple method to give you a 30% performance improvement in &lt;a href="http://www.infragistics.com/products/wpf/grid" target="_blank"&gt;XamGrid&lt;/a&gt; scrolling performance by using simpler templates. This blog post describes the approach and illustrates it with a sample project you can use to compare the scrolling performance of the &lt;a href="http://www.infragistics.com/products/wpf/grid" target="_blank"&gt;XamGrid&lt;/a&gt; using the different setups.&lt;/p&gt;
&lt;p&gt;In this blog post I will illustrate how to use simpler templates to replace DateColumn and DateTimeColumn cell templates in XamGrid, and demonstrate how this can significantly improve scrolling performance. Please download the &lt;a href="http://users.infragistics.com/kmatev/blogs/xamgridperformance.zip"&gt;sample project&lt;/a&gt; &amp;ndash; it enables you to show/hide date columns in a &lt;a href="http://www.infragistics.com/products/wpf/grid" target="_blank"&gt;XamGrid&lt;/a&gt;, and allows you to benchmark the time it takes to scroll through the dataset. &lt;strong&gt;Please remember to &lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.Tuning+the+XamDataChart+for+Blazing-Fast+Charting/unblockZIP.jpg" target="_blank"&gt;unblock the ZIP archive&lt;/a&gt; before extracting it. &lt;/strong&gt;The project is built using Visual Studio 2010 and .NET Framework 4. It uses the latest available service release of the 12.1 WPF product, so you can build and run it without any additional downloads. &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;Fully-functional free 30-day trial&lt;/a&gt; of the &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt; product, which includes the &lt;a href="http://www.infragistics.com/products/wpf/grid" target="_blank"&gt;XamGrid&lt;/a&gt; is &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;available&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Please see below a screenshot of the &lt;a href="http://www.infragistics.com/products/wpf/grid" target="_blank"&gt;XamGrid&lt;/a&gt; which uses &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt; columns to display date values, together with the time it takes for the grid to page through the entire dataset.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/4682.XamGridOptimization_5F00_2.jpg"&gt;&lt;img style="background-image:none;padding-left:0px;padding-right:0px;display:inline;padding-top:0px;border-width:0px;" title="XamGridOptimization" border="0" alt="XamGridOptimization" src="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/0486.XamGridOptimization_5F00_thumb.jpg" width="717" height="539" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Date value presentation&lt;/h2&gt;
&lt;p&gt;The default column type for date-typed columns is the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=xamGrid_DateColumn.html" target="_blank"&gt;DateColumn&lt;/a&gt;. Recently, we&amp;rsquo;ve introduced the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt; as a replacement for this default column for visualization of date values. These editors provide a powerful UI for editing the date value, both using a formatted editor in the cell, and also using a date picker which is popped up when the user clicks the arrow button. However, this advanced functionality comes at the price of additional UI elements. Here&amp;rsquo;s an image showing the element tree of a cell in the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt;. You can see it uses a total of 27 elements to represent this value and give the user the ability to edit it easily. When you have multiple date columns visible at one time, and when you have a number of records visible, this increased number of elements starts to have an impact on scrolling performance. When you need to edit these values, this may be a price you may be willing to pay. However, when you don&amp;rsquo;t need to edit these values, the extra functionality provided by the additional UI elements isn&amp;rsquo;t used. Simplifying the cell template to only present the value can yield a noticeable improvement in scrolling performance.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/1464.DateTimeColumnElementTree_5F00_2.jpg"&gt;&lt;img style="background-image:none;padding-left:0px;padding-right:0px;display:inline;padding-top:0px;border-width:0px;" title="DateTimeColumnElementTree" border="0" alt="DateTimeColumnElementTree" src="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/1376.DateTimeColumnElementTree_5F00_thumb.jpg" width="272" height="318" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Simplified Templates for Date value presentation&lt;/h2&gt;
&lt;p&gt;If we use a simple &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.XamGrid.v12.1~Infragistics.Controls.Grids.TextColumn.html" target="_blank"&gt;TextColumn&lt;/a&gt; to represent a Date value we don&amp;rsquo;t get the editing capabilities, but we cut down 27 UI elements the standard &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt; cell uses by 4 times to only 7 elements as shown in the element tree below:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/3108.TextColumnElementTree_5F00_2.jpg"&gt;&lt;img style="background-image:none;padding-left:0px;padding-right:0px;display:inline;padding-top:0px;border-width:0px;" title="TextColumnElementTree" border="0" alt="TextColumnElementTree" src="http://www.infragistics.com/community/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.metablogapi/1464.TextColumnElementTree_5F00_thumb.jpg" width="276" height="154" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Using the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.XamGrid.v12.1~Infragistics.Controls.Grids.TextColumn.html"&gt;TextColumn&lt;/a&gt; instead of the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html"&gt;DateTimeColumn&lt;/a&gt; enables us to significantly reduce the load on the CLR which needs to go through the measure and arrange passes for a significantly smaller number of UIElements. This results in better scrolling performance. How much better exactly?&lt;/p&gt;
&lt;h2&gt;Performance Benchmarking&lt;/h2&gt;
&lt;p&gt;The sample includes a grid containing columns of different types, which can be paged automatically, with the scrolling time displayed once scrolling has completed. The &lt;a href="http://www.infragistics.com/products/wpf/grid" target="_blank"&gt;XamGrid&lt;/a&gt; has (among many more) 4 date-typed columns &amp;ndash; the first one is shown using a &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.XamGrid.v12.1~Infragistics.Controls.Grids.TextColumn.html" target="_blank"&gt;TextColumn&lt;/a&gt;, the other four are shown using &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt;. The column chooser functionality is enabled, and you can hide a column by clicking the button on the right of its title in the column header cell (you can show a hidden column by clicking its name in the list that pops up when you click the region where the column was collapsed into). Adjust the sample to fit your requirements by setting the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.XamGrid.v12.1~Infragistics.Controls.Grids.XamGrid~ColumnWidth.html" target="_blank"&gt;ColumnWidth&lt;/a&gt;, and &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.XamGrid.v12.1~Infragistics.Controls.Grids.XamGrid~RowHeight.html" target="_blank"&gt;RowHeight&lt;/a&gt; properties on the &lt;a href="http://www.infragistics.com/products/wpf/grid" target="_blank"&gt;XamGrid&lt;/a&gt;. You can leave them as they are if you&amp;rsquo;d like to see the general effect on scrolling performance.&lt;/p&gt;
&lt;p&gt;1. Click the Benchmark button to start the automatic paging to get a baseline performance level with 4 &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt;s columns shown. You can repeat a few times to get a more accurate idea of the time it takes to page through.&lt;/p&gt;
&lt;p&gt;2. Hide one or more of the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt; columns (Date1, Date2, Date3, Date4)&lt;/p&gt;
&lt;p&gt;3. Click the Benchmark button to start the automatic paging with the new column configuration. You can repeat a few times to get a more accurate idea of the time it takes to page through.&lt;/p&gt;
&lt;h2&gt;Results&lt;/h2&gt;
&lt;p&gt;5 date-typed columns are visible, 1 date value shown in a TextColumn, and 4 shown using &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt;s. The scroll time averages at 5.6s.&lt;/p&gt;
&lt;p&gt;4 date-typed columns are visible, 1 date value shown in a TextColumn, and 3 shown using &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt;s. The scroll time averages at 3.9s.&lt;/p&gt;
&lt;p&gt;3 date-typed columns are visible, 1 date value shown in a TextColumn, and 2 shown using &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt;s. The scroll time averages at 2.9s.&lt;/p&gt;
&lt;p&gt;2 date-typed columns are visible, 1 date value shown in a TextColumn, and 1 shown using &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt;. The scroll time averages at 1.8s.&lt;/p&gt;
&lt;p&gt;1 date-typed columns are visible, 1 date value shown in a TextColumn, and none shown using &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt;. The scroll time averages at 1.1s.&lt;/p&gt;
&lt;p&gt;You can easily see the dramatic effect on performance achieved by using a simple &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.XamGrid.v12.1~Infragistics.Controls.Grids.TextColumn.html" target="_blank"&gt;TextColumn&lt;/a&gt; for the visualization of date values instead of &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt; columns. This performance win is easily achievable when you don&amp;rsquo;t allow users to edit date values, because you don&amp;rsquo;t sacrifice any aspect of functionality by using a &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.XamGrid.v12.1~Infragistics.Controls.Grids.TextColumn.html" target="_blank"&gt;TextColumn&lt;/a&gt; instead of a &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt;. The fact that the date columns are hidden doesn&amp;rsquo;t mean we improved performance by showing less data &amp;ndash; the grid has more than&amp;nbsp; 40 columns, and it shows the same amount of data, since all columns have equal width. The values which are coming in from columns on the right now that we&amp;rsquo;ve hidden the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt; columns are numbers and simple text, which are displayed using simple &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.XamGrid.v12.1~Infragistics.Controls.Grids.TextColumn.html" target="_blank"&gt;TextColumns&lt;/a&gt;, which only use 7 UIElements to present their values. This is why even though we&amp;rsquo;re showing the same amount of data, we&amp;rsquo;re able to improve scrolling performance by about 4 times, a multiple of the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt; columns we&amp;rsquo;ve been able to replace by &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.XamGrid.v12.1~Infragistics.Controls.Grids.TextColumn.html" target="_blank"&gt;TextColumns&lt;/a&gt; in view (the fact that these previously hidden from view &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.XamGrid.v12.1~Infragistics.Controls.Grids.TextColumn.html" target="_blank"&gt;TextColumns&lt;/a&gt; show different data types doesn&amp;rsquo;t impact the results).&lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;in this blog post, I presented a simple way to improve performance on your &lt;a href="http://www.infragistics.com/products/wpf/grid" target="_blank"&gt;XamGrid&lt;/a&gt; by replacing &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=xamGrid_DateColumn.html" target="_blank"&gt;DateColumn&lt;/a&gt; and &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.DateTimeColumn.v12.1~Infragistics.Controls.Grids.DateTimeColumn.html" target="_blank"&gt;DateTimeColumn&lt;/a&gt; with &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Controls.Grids.XamGrid.v12.1~Infragistics.Controls.Grids.TextColumn.html" target="_blank"&gt;TextColumns&lt;/a&gt;. As demonstrated by the sample, this substantially cuts down the load on the CLR and results in greatly improved scrolling performance. In addition to the general approach, you can also use the sample project for its automatic paging logic, which will enable you to benchmark the effect of different settings/templates on performance. Using this approach in &lt;a href="http://www.infragistics.com/products/wpf/grid" target="_blank"&gt;XamGrid&lt;/a&gt;s displaying read-only date values, you can easily improve scrolling performance and thus increase user satisfaction.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=367283" width="1" height="1"&gt;</content><author><name>kmatev</name><uri>http://www.infragistics.com/profile/MzAzNzk=</uri></author><category term="WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/WPF/default.aspx" /><category term="Grid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Grid/default.aspx" /><category term="XamGrid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/XamGrid/default.aspx" /><category term="Performance" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Performance/default.aspx" /></entry><entry><title>Optimizing XamDataGrid Scrolling Performance Using Simplified Templates</title><link rel="alternate" type="text/html" href="/community/blogs/kiril_matev/archive/2012/07/23/xamdatagrid-performance-optimization-using-simplified-templates-and-forced-cell-virtualization.aspx" /><id>/community/blogs/kiril_matev/archive/2012/07/23/xamdatagrid-performance-optimization-using-simplified-templates-and-forced-cell-virtualization.aspx</id><published>2012-07-23T16:28:00Z</published><updated>2012-07-23T16:28:00Z</updated><content type="html">&lt;p&gt;The &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; control is a highly-functional high-performance grid control that&amp;rsquo;s a part of the &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt; (&lt;a href="http://www.infragistics.com/products/wpf/samples" target="_blank"&gt;samples&lt;/a&gt;), along with other controls for line of business applications, such as &lt;a href="http://www.infragistics.com/products/wpf/multicolumn-combo/" target="_blank"&gt;editors&lt;/a&gt;, &lt;a href="http://www.infragistics.com/products/wpf/dock-manager/" target="_blank"&gt;docking&lt;/a&gt;, &lt;a href="http://www.infragistics.com/products/wpf/ribbon/" target="_blank"&gt;ribbon&lt;/a&gt;, &lt;a href="http://www.infragistics.com/products/wpf/schedule/" target="_blank"&gt;scheduler&lt;/a&gt;, and others. These controls have been used in a number of industries to build richly-styled and highly-functional applications. However, users are using increasing quantities of data, which puts strain on the performance of highly-customizable UIs. In this blog post, I&amp;rsquo;ll present one approach to improving performance of the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; to help you achieve up to &amp;nbsp;20% decrease in scrolling speed. For additional guidance on &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; performance optimization, please see this &lt;a href="http://www.infragistics.com/community/blogs/kiril_matev/archive/2010/10/26/optimizing-xamdatagrid-performance.aspx" target="_blank"&gt;blogpost&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In this blog post I will present simplified cell templates for &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt;, and illustrate how they can significantly improve scrolling performance. Please download the &lt;a href="http://users.infragistics.com/kmatev/blogs/xamdatagridperformance.zip" title="sample project"&gt;sample project&lt;/a&gt; &amp;ndash; it enables you to switch between the different cell templates of a &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt;, and allows you to benchmark the time it takes to scroll through the dataset. &lt;strong&gt;Please remember to &lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.Tuning+the+XamDataChart+for+Blazing-Fast+Charting/unblockZIP.jpg"&gt;unblock the ZIP archive&lt;/a&gt; before extracting it. &lt;/strong&gt;The project is built using Visual Studio 2010 and .NET Framework 4. It uses the latest available service release of the 12.1 WPF product, so you can build and run it without any additional downloads. &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;Fully-functional free 30-day trial&lt;/a&gt; of the &lt;a href="http://www.infragistics.com/products/wpf/" target="_blank"&gt;NetAdvantage for WPF&lt;/a&gt;&amp;nbsp;product, which includes the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; is &lt;a href="http://www.infragistics.com/dotnet/netadvantage/ultimate.aspx#Downloads" target="_blank"&gt;available&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Please see below a screenshot of the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; with the default cell templates, together with the time it takes for the grid to page through the entire dataset.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="http://img842.imageshack.us/img842/7417/xdgnormaltemplate.jpg" width="500" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;The above screenshot shows the default cell value template you get in the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; cells &amp;ndash; editors enabling your user to easily edit cell values for the corresponding data types. Each of these editors is made up of UIElements which need to be managed by the CLR.&amp;nbsp; The more sophisticated an editor, the more UIElements need to be managed, and the higher the price we pay in terms of performance.&amp;nbsp; With this in mind, we can improve &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; scrolling performance by using simpler ways to present a value, thus cutting down on the number of UIElements to be managed by the CLR.&lt;/p&gt;
&lt;h3&gt;CellValuePresenter Templates&lt;/h3&gt;
&lt;p&gt;A &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Editors.v12.1~Infragistics.Windows.Editors.XamNumericEditor.html" target="_blank"&gt;XamNumericEditor&lt;/a&gt; or &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Editors.v12.1~Infragistics.Windows.Editors.XamCurrencyEditor.html" target="_blank"&gt;XamCurrencyEditor&lt;/a&gt; uses 7 elements to display a single value because the user can edit the value using spin buttons. You can see the element tree below:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="http://img27.imageshack.us/img27/3575/xamcurrencyeditorelemen.jpg" width="428" height="308" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;However, very often, especially when dealing with large volumes or rapidly updating data, most of the data shown is not editable. Setting the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.FieldSettings~AllowEdit.html" target="_blank"&gt;AllowEdit&lt;/a&gt; property in the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.FieldSettings.html" target="_blank"&gt;FieldSettings&lt;/a&gt; doesn&amp;rsquo;t use a simpler template for presenting the value, just disables the editor and doesn&amp;rsquo;t improve performance.&amp;nbsp; When we&amp;rsquo;re dealing with read-only data, we only need to present the data as a read-only label, instead of an editor. This will help us cut down the number of UIElements and hence improve performance. The simplest possible template is one where we use a single TextBlock element to present a value with a Border element, so we can have border and background styling. You can see the element tree of this template below:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="http://img43.imageshack.us/img43/3273/readonlystyleelements.jpg" width="379" height="218" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;You can see that a default &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.CellValuePresenter.html" target="_blank"&gt;CellValuePresenter&lt;/a&gt; is composed of 12 elements, while a slimmed-down one only has 3 elements. This is a 4-fold decrease in the number of elements per cell. The more cells you have in view, the bigger the total number of UIElements saved by using simple read-only styles. The more UIElements saved, the more performance will improve.&lt;/p&gt;
&lt;h3&gt;Performance Comparison&lt;/h3&gt;
&lt;p&gt;You can easily see the effect using slimmed down templates has on performance. The sample is a large dataset, with more than 50 columns, and 2000 rows. This data is grouped using three columns to provide a realistic scrolling scenario where group header rows are also present along with regular data rows. To test performance run the sample application, click the Expand all button, then click the Benchmark scrolling button. This will page through the entire dataset, and report the time that took on the top-right for the current &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.CellValuePresenter.html" target="_blank"&gt;CellValuePresenter&lt;/a&gt; template. You can change the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.CellValuePresenter.html" target="_blank"&gt;CellValuePresenter&lt;/a&gt; template using the radio buttons on the top-left side. Go through the different templates (normal, read-only, grid lines read-only) and click the Benchmark scrolling button. The results will vary depending on the number of cells shown, with a smaller grid shown leading to better performance.&lt;/p&gt;
&lt;p&gt;Using the window size as provided by the sample (1024x768), we had the following times:&lt;/p&gt;
&lt;p&gt;Normal template: 12.561s&lt;/p&gt;
&lt;p&gt;Read-only: 9.502s&lt;/p&gt;
&lt;p&gt;Grid lines read-only: 10.29s&lt;/p&gt;
&lt;p&gt;You may get different results due to the hardware you&amp;rsquo;re running the sample on, but you&amp;rsquo;ll certainly see about a 20% improvement in scrolling time when using read-only templates versus standard ones.&lt;/p&gt;
&lt;h3&gt;Editor recycling&lt;/h3&gt;
&lt;p&gt;When we changed the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.CellValuePresenter.html" target="_blank"&gt;CellValuePresenter&lt;/a&gt; to use a simple TextBlock, it doesn&amp;rsquo;t contain a ValueEditor anymore. This prevents the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; from determining if it should instantiate a cell if it isn&amp;rsquo;t in view (horizontally scrolled out of view). Since this uninitialized cell may affect the height of the record, the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; lacking any other information will hydrate it. However, setting the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.FieldSettings~ForceCellVirtualization.html" target="_blank"&gt;ForceCellVirtualization&lt;/a&gt; to true (in the XAML code), we tell the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; that the cell is safe to be virtualized. Once we&amp;rsquo;ve set this property to true, this lets us benefit from the slimmer &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.CellValuePresenter.html" target="_blank"&gt;CellValuePresenter&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Note: Setting &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.FieldSettings~ForceCellVirtualization.html" target="_blank"&gt;ForceCellVirtualization&lt;/a&gt; to true doesn&amp;rsquo;t guarantee that the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; will re-use the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.CellValuePresenter.html" target="_blank"&gt;CellValuePresenter&lt;/a&gt; for another field&amp;rsquo;s cell when the user scrolls horizontally. If the data types, or styles don&amp;rsquo;t match, the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; won&amp;rsquo;t re-use it for that field.&lt;/p&gt;
&lt;h3&gt;Implications&lt;/h3&gt;
&lt;p&gt;Using a slimmer &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.CellValuePresenter.html" target="_blank"&gt;CellValuePresenter&lt;/a&gt; template can impact your existing codebase in two ways &amp;ndash; styling and value formatting.&lt;/p&gt;
&lt;p&gt;You may need to change styles you&amp;rsquo;re using to target the elements of the slimmed down templates instead of the standard &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v12.1~Infragistics.Windows.DataPresenter.CellValuePresenter.html" target="_blank"&gt;CellValuePresenter&lt;/a&gt; template elements. The read-only styles provided in this sample (both the regular and grid-lines one) include a border element which can be used to set the background and border of the cell. Depending on the richness you require, you may add additional elements you&amp;rsquo;d like to target using your styles.&lt;/p&gt;
&lt;p&gt;The TextBlock doesn&amp;rsquo;t format the cell values the way a &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Editors.v12.1~Infragistics.Windows.Editors.XamNumericEditor.html" target="_blank"&gt;XamNumericEditor&lt;/a&gt; or &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2012.1/CLR4.0/?page=InfragisticsWPF4.Editors.v12.1~Infragistics.Windows.Editors.XamCurrencyEditor.html" target="_blank"&gt;XamCurrencyEditor&lt;/a&gt; can. With these full-fledged editors you have complete control over value formatting, with currency symbols, thousand separators and decimal places as examples. When using a simpler template with a TextBlock, you&amp;rsquo;ll need to format values as strings before you provide them to the UI layer, because without an editor in place they won&amp;#39;t get formatted automatically.&lt;/p&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;p&gt;The &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; control is the mainstay of line of business applications. Its flexibility, feature-richness, stylability, and performance have ensured its wide use in WPF applications in a variety of sectors with demanding requirements. In this blogpost, I described one way to enhance its performance in specific when dealing with read-only data. This sample also gives you the ability to easily compare the scrolling performance with different &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; settings because of its ready-to-use automatic scrolling and timing capabilities. In case you&amp;rsquo;d like to improve scrolling speed, armed with this sample and the guidance above, you will be able to customize the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; to get the maximum level of performance and improve the experience your users have when using your application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=364126" width="1" height="1"&gt;</content><author><name>kmatev</name><uri>http://www.infragistics.com/profile/MzAzNzk=</uri></author><category term="WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/WPF/default.aspx" /><category term="Grid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Grid/default.aspx" /><category term="XamDataGrid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/XamDataGrid/default.aspx" /><category term="Performance" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Performance/default.aspx" /><category term="NetAdvantage for WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/NetAdvantage+for+WPF/default.aspx" /></entry><entry><title>Optimizing Sorting Update Performance in XamDataGrid</title><link rel="alternate" type="text/html" href="/community/blogs/kiril_matev/archive/2012/04/10/optimizing-sorting-update-performance-in-xamdatagrid.aspx" /><id>/community/blogs/kiril_matev/archive/2012/04/10/optimizing-sorting-update-performance-in-xamdatagrid.aspx</id><published>2012-04-10T17:53:00Z</published><updated>2012-04-10T17:53:00Z</updated><content type="html">&lt;p&gt;The &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; , the grid control which comes as a part of the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf.aspx#Overview" target="_blank"&gt;NetAdvantage for WPF Line of Business&lt;/a&gt; product, has been in use for a few years in a variety of scenarios &amp;ndash; from customizability and rich templating, to high data density and high-performance. Recently, we have made an important addition to its API, which lets developers handle sorting in update scenarios without sacrificing any aspect of performance (detailed performance optimization guidance is &lt;a href="http://blogs.infragistics.com/blogs/kiril_matev/archive/2010/10/26/optimizing-xamdatagrid-performance.aspx" target="_blank"&gt;available here&lt;/a&gt;). This blog post describes this new capability and illustrates its implementation in a sample project. It also demonstrates its importance by comparing the number of calls to the repositioning logic made with the old and new approaches to handling record repositioning.&lt;/p&gt;
&lt;p&gt;Please download the &lt;a target="_blank" href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.Optimizing+Sorting+Update+Performance+in+XamDataGrid/XamDataGridSortingPerformance2.zip"&gt;sample project&lt;/a&gt; &amp;ndash; it implements both the old wasteful and the new optimized approach to record repositioning and keeps track of the number of repositioning logic calls made using the two. &lt;strong&gt;Please remember to &lt;a target="_blank" href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.Tuning+the+XamDataChart+for+Blazing-Fast+Charting/unblockZIP.jpg"&gt;unblock the ZIP archive&lt;/a&gt; before extracting it. &lt;/strong&gt;The project is built using Visual Studio 2010 and .NET Framework 4. It uses the latest available service release of the 11.2 WPF product, so you can build and run it without any additional downloads. &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/wpf.aspx#Downloads"&gt;Fully-functional free 30-day trial&lt;/a&gt;&amp;nbsp;of the &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/wpf.aspx#Overview"&gt;NetAdvantage for WPF Line of Business&lt;/a&gt; product, which includes the &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview"&gt;XamDataGrid&lt;/a&gt; is &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/ultimate.aspx#Downloads"&gt;available&lt;/a&gt;.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Please see the screenshot below and note the 7 times fewer invocations of repositioning logic using the new approach. The reason for this is that record repositioning is only done in response to an update on the sorted field, rather than every time there&amp;#39;s an update on any of the fields of the record. This is why the performance improvement you will see will depend on the number of updated fields - the more fields you have updating, the bigger the performance improvement of using the new approach.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/XamDataGridRefreshSortPosition.jpg"&gt;&lt;img border="0" src="http://blogs.infragistics.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/XamDataGridRefreshSortPosition.jpg" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Handling record updates (old approach)&lt;/h2&gt;
&lt;p&gt;By default, the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; doesn&amp;rsquo;t reposition a record in a sorted or grouped grid once its sorted/grouped property value changes. In this way, the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; lets the developer have full control over the timing of the repositioning operation and doesn&amp;rsquo;t sacrifice any performance by automatic repositioning in case it&amp;rsquo;s not needed by the scenario. This applies when sorting and grouping is activated from the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; itself, rather than bound to a data source which sorts the values intrinsically such as a ListCollectionView which has sort-descriptors set. In the latter case, the ListCollectionView handles the sorting and the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; repositions the records automatically.&lt;/p&gt;
&lt;p&gt;In case you&amp;rsquo;re not using a ListCollectionView, but the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; sorting instead, you&amp;rsquo;ll have to reposition records manually when there&amp;rsquo;s an update in response to the user changing the value of the sorted column, or an update coming in from the data source. This requires the developer to handle the&amp;nbsp;&lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v11.2~Infragistics.Windows.DataPresenter.DataPresenterBase~InitializeRecord_EV.html" target="_blank"&gt;InitializeRecord&lt;/a&gt;&amp;nbsp;routed&amp;nbsp;event or its plain CLR event counterpart -&amp;nbsp;&lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v11.2~Infragistics.Windows.DataPresenter.DataPresenterBase~InitializeRecordDirect_EV.html" target="_blank"&gt;InitializeRecordDirect&lt;/a&gt;&amp;nbsp;where the&amp;nbsp;&lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v11.2~Infragistics.Windows.DataPresenter.Record~RefreshSortPosition.html" target="_blank"&gt;RefreshSortPosition &lt;/a&gt;method is called on the record. Until now, this was typically performed using the code below:&lt;/p&gt;
&lt;pre&gt;private void xamDataGrid1_InitializeRecordDirect(object sender, Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs e)
{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;     //we have to call the RefreshSortPosition method, or else the records do not get their group placement updated after a data update&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;     if (e.ReInitialize)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;     {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;           //logic to be performed before repositioning&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;           e.Record.RefreshSortPosition();&lt;br /&gt;           //logic to be performed before repositioning&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/pre&gt;
&lt;pre&gt;     }&lt;/pre&gt;
&lt;pre&gt;}&lt;/pre&gt;
&lt;h2&gt;Handling record updates (new approach)&lt;/h2&gt;
&lt;p&gt;The &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v11.2~Infragistics.Windows.DataPresenter.DataPresenterBase~InitializeRecord_EV.html" target="_blank"&gt;InitializeRecord&lt;/a&gt; event is called every time there is a change in any of the record&amp;rsquo;s fields. This means that if we have a record containing 10 fields, all of which are updated by the user or by a background process, the record repositioning logic is invoked regardless of whether the column the user has sorted on was updated. This is a rather wasteful approach, because assuming we have sorted by one of these fields, the repositioning logic is called 10 times, instead of just once in response to the sorted column being updated. This is why in the currently available &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf.aspx#Downloads" target="_blank"&gt;service release version of the 11.2 release&lt;/a&gt; (build 2125), we have added the SortValueChanged property to the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v11.2~Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs.html" target="_blank"&gt;InitializeRecordEventArgs&lt;/a&gt; which lets the developer know whether the record is initialized because sorted column value has changed, allowing them to call the repositioning logic only when required. &lt;strong&gt;This new property appears in all subsequent versions, including the forthcoming 12.1 release.&lt;/strong&gt; This changes the code above into the following:&lt;/p&gt;
&lt;pre&gt;private void xamDataGrid1_InitializeRecordDirect(object sender, Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs e)
{
     //we have to call the RefreshSortPosition method, or else the records do not get their group placement updated after a data update
     if (e.SortValueChanged)
     {
         //logic to be performed before repositioning
         e.Record.RefreshSortPosition();&lt;br /&gt;         //logic to be performed before repositioning            &lt;/pre&gt;
&lt;pre&gt;     }&lt;/pre&gt;
&lt;pre&gt;}&lt;/pre&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;In this blogpost, I described the new API introduced in the 11.2 service release of the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf.aspx#Overview" target="_blank"&gt;NetAdvantage for WPF Line of Business&lt;/a&gt; product, which lets you dramatically cut down the number of calls to repositioning logic in the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; in response to data updates. This approach will let you achieve a finer level of control over when record positioning logic is invoked, and ultimately improve performance in these scenarios.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=343774" width="1" height="1"&gt;</content><author><name>kmatev</name><uri>http://www.infragistics.com/profile/MzAzNzk=</uri></author><category term="WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/WPF/default.aspx" /><category term="real-time data" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/real-time+data/default.aspx" /><category term="XamDataGrid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/XamDataGrid/default.aspx" /><category term="Performance" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Performance/default.aspx" /><category term="NetAdvantage for WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/NetAdvantage+for+WPF/default.aspx" /></entry><entry><title>Implementing Modern Business Application Layout with XamTileManager</title><link rel="alternate" type="text/html" href="/community/blogs/kiril_matev/archive/2012/01/20/implementing-modern-business-application-layout-with-xamtilemanager.aspx" /><id>/community/blogs/kiril_matev/archive/2012/01/20/implementing-modern-business-application-layout-with-xamtilemanager.aspx</id><published>2012-01-20T12:00:00Z</published><updated>2012-01-20T12:00:00Z</updated><content type="html">&lt;p&gt;WPF and Silverlight give developers the technology to easily create highly interactive UI. Our &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization.aspx#Overview" target="_blank"&gt;NetAdvantage for WPF Data Visualization&lt;/a&gt;&amp;nbsp;(&lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization.aspx#Downloads"&gt;trial&lt;/a&gt;)&amp;nbsp;and &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization.aspx#Overview" target="_blank"&gt;NetAdvantage for Silverlight Data Visualization&lt;/a&gt;&amp;nbsp;(&lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization.aspx#Downloads"&gt;trial&lt;/a&gt;)&amp;nbsp;products make use of that, and include a number of controls which allow you to visualize your data in an interactive way, such as a &lt;a href="http://samples.infragistics.com/sldv/ComponentOverview.aspx?cn=data-chart" target="_blank"&gt;chart&lt;/a&gt;, &lt;a href="http://samples.infragistics.com/sldv/ComponentOverview.aspx?cn=geographic-map" target="_blank"&gt;geographic map&lt;/a&gt;, &lt;a href="http://samples.infragistics.com/sldv/ComponentOverview.aspx?cn=treemap" target="_blank"&gt;treemap&lt;/a&gt;, and so on (&lt;a target="_blank" href="http://samples.infragistics.com/sldv/"&gt;samples&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt; Another area where applications can clearly benefit from the increased interaction capabilities introduced by WPF is layout. This blog describes often used layout controls with their advantages and limitations, and presents the &lt;a href="http://samples.infragistics.com/sllob/ComponentOverview.aspx?cn=tile-manager" target="_blank"&gt;XamTilesManager&lt;/a&gt;, which is available for both &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/tile-manager.aspx#Overview" target="_blank"&gt;WPF&lt;/a&gt; and &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamwebtileview.aspx#Overview" target="_blank"&gt;Silverlight&lt;/a&gt;&amp;nbsp;which can enable you to deliver a highly customizable and easy to use layout. Here is a screenshot of a flexible layout arrangement built using the &lt;a href="http://samples.infragistics.com/sllob/ComponentOverview.aspx?cn=tile-manager" target="_blank"&gt;XamTilesManager&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization.aspx#Downloads"&gt;&lt;img border="0" src="http://blogs.infragistics.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/XamTilesMgrScrshot1.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Grids, Splitters, Tabs &amp;ndash; easy to implement, however inflexible&lt;/h3&gt;
&lt;p&gt;Layout in many Windows Forms and WPF applications is organized using a grid or tab metaphor &amp;ndash; different groups of controls, or different views are placed within the same view, or on different pages in a tab strip. Even though this layout paradigm is probably the easiest to implement, it makes the UI inflexible, because the user has no control over the layout and ordering of the different views. As an application evolves, new screens get added to the existing layout paradigm, resulting in more difficult navigation and continual switching from one view to another. This in turn frustrates the user and causes dissatisfaction and low productivity, indicating that something needs to change.&lt;/p&gt;
&lt;h3&gt;Docking &amp;ndash; highly customizable layout, however overly complex&lt;/h3&gt;
&lt;p&gt;When &amp;nbsp;flexible layout is needed, developers implement that with a docking manager, which is also a part of our &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdockmanager.aspx#Overview" target="_blank"&gt;WPF&lt;/a&gt; and &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/dock-manager.aspx#Overview" target="_blank"&gt;Silverlight&lt;/a&gt; products (&lt;a href="http://samples.infragistics.com/sllob/ComponentOverview.aspx?cn=dock-manager" target="_blank"&gt;samples&lt;/a&gt;). The &lt;a target="_blank" href="http://samples.infragistics.com/sllob/ComponentOverview.aspx?cn=dock-manager"&gt;docking manager&lt;/a&gt; enables users to customize the layout of different views on single or multiple monitors, and &lt;a target="_blank" href="http://samples.infragistics.com/sllob/RunSamples.aspx?cn=dock-manager#/dock-manager/display-floating-panes"&gt;create floating &lt;/a&gt;and &lt;a target="_blank" href="http://samples.infragistics.com/sllob/RunSamples.aspx?cn=dock-manager#/dock-manager/docking-multiple-panes-in-a-tabgrouppane"&gt;nested panes&lt;/a&gt;. One example of this layout paradigm is the Visual Studio coding and debugging docking layouts, which arrange views&amp;nbsp; differently depending on the context of use of the application. The reason docking is quite appropriate for Visual Studio is that we as developers are primarily working with the code window, and are making occasional use of the other windows around it. We don&amp;rsquo;t need to change the layout much, because we&amp;rsquo;re focused on one of the views most of the time. &lt;/p&gt;
&lt;p&gt;Docking is useful when the layout arrangement is relatively stable, because even as docking enables highly complex docking layouts, it does not enable the user to easily switch between different configurations. Furthermore, creating a good docking layout often takes time to produce, and is difficult to change, due to the overwhelming variety of ways panes can be rearranged. This makes docking a less-than-perfect candidate for the layout of an application where the user needs to often switch from one view to another.&lt;/p&gt;
&lt;h3&gt;Tiles &amp;ndash; simpler layouts than docking, facilitates easy switching between them&lt;/h3&gt;
&lt;p&gt;In order to easily navigate an application with more than a few screens/views, and to easily focus on a view without needing to rearrange everything, users need layout to meet the following goals:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Layout should be easily rearranged to focus on different views at different times &lt;/li&gt;
&lt;li&gt;While focusing on one or two views, layout should ensure all other views are out of focus, but still readily accessible &lt;/li&gt;
&lt;li&gt;Layout should allow a view to present a concise version of itself when not in focus with only the relevant information presented (new leads, customer requests pending), without presenting the full view itself &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The
&lt;a href="http://samples.infragistics.com/sllob/ComponentOverview.aspx?cn=tile-manager" target="_blank"&gt;XamTileManager&lt;/a&gt;&amp;nbsp;(available in&amp;nbsp;both&amp;nbsp;&lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamwebtileview.aspx#Overview"&gt;Silverlight&amp;nbsp;&lt;/a&gt;and&amp;nbsp;&lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/tile-manager.aspx#Overview" target="_blank"&gt;WPF&lt;/a&gt;&amp;nbsp;products)&amp;nbsp;enables the above interactions because of the following characteristics:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Supports different states of tiles &amp;ndash; minimized, maximized, normal, minimized-expanded. This enables different content to be shown depending on whether the tile is currently the focus of the user&amp;rsquo;s attention (the tile is maximized), or is currently occupying a small part of the screen and should only show essential information about its status. &lt;/li&gt;
&lt;li&gt;Contains a limited amount of interactions such as switching, resizing and changing the state of a tile (minimized, maximized, minimized-expanded). Does not support nesting and pinning of tiles, greatly reducing the possible number of configurations, making it easy for the user to rearrange a layout &lt;/li&gt;
&lt;li&gt;Once a tile or tiles are maximized, all other tiles are automatically minimized &lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;p&gt;In this blogpost, different ways to organize layout were presented, along with their advantages and disadvantages. We demonstrated the limitations of simple layout, and the overly complex nature of docking, and the suitability of tiled layouts for applications that make the best use of available space. In a following post, we will demonstrate specifically how to setup the &lt;a href="http://samples.infragistics.com/sllob/ComponentOverview.aspx?cn=tile-manager" target="_blank"&gt;XamTileManager&lt;/a&gt; to fit one such scenario. For the time being, you can view the &lt;a target="_blank" href="http://samples.infragistics.com/sllob/ComponentOverview.aspx?cn=tile-manager"&gt;online samples&lt;/a&gt; (identical in &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamwebtileview.aspx#Overview"&gt;Silverlight &lt;/a&gt;and &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/tile-manager.aspx#Overview" target="_blank"&gt;WPF&lt;/a&gt;), or open the Equity Trading showcase, which is a part of the &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/wpf.aspx"&gt;NetAdvantage for WPF&amp;nbsp;Line of Business&lt;/a&gt;&amp;nbsp;(&lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/wpf.aspx#Downloads"&gt;trial&lt;/a&gt;) samples applications (source code included). It demonstrates how the tiling concept can be used to achieve a layout that&amp;rsquo;s flexible and easy to change, so you can decide whether and how this concept can enhance the layout experience in the applications you&amp;rsquo;re building.&lt;/p&gt;
&lt;p&gt;If you have any questions or comments, you can reach me at &lt;a href="mailto:kmatev@infragistics.com"&gt;kmatev@infragistics.com&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=326885" width="1" height="1"&gt;</content><author><name>kmatev</name><uri>http://www.infragistics.com/profile/MzAzNzk=</uri></author><category term="WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/WPF/default.aspx" /><category term="Line of business" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Line+of+business/default.aspx" /><category term="NetAdvantage for WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/NetAdvantage+for+WPF/default.aspx" /></entry><entry><title>Building the Sales Reporting Showcase - Use cases and controls</title><link rel="alternate" type="text/html" href="/community/blogs/kiril_matev/archive/2011/12/29/building-the-sales-reporting-showcase-use-cases-and-controls.aspx" /><id>/community/blogs/kiril_matev/archive/2011/12/29/building-the-sales-reporting-showcase-use-cases-and-controls.aspx</id><published>2011-12-29T09:06:00Z</published><updated>2011-12-29T09:06:00Z</updated><content type="html">&lt;p&gt;The Infragistics Sales Reporting showcase, which is &lt;a target="_blank" href="http://labs.infragistics.com/silverlightdv/Showcases/SalesReporting/"&gt;available here&lt;/a&gt; illustrates how to build a simple application using Silverlight. It implements the functionality found in a simple reporting system, and is built using &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/line-of-business.aspx#Overview"&gt;Infragistics NetAdvantage for Silverlight Line of Business&lt;/a&gt; (&lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/line-of-business.aspx#Downloads"&gt;download&lt;/a&gt;, &lt;a href="http://samples.infragistics.com/sllob/"&gt;samples&lt;/a&gt;) and &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization.aspx#Overview"&gt;Infragistics NetAdvantage for Silverlight Data Visualization&lt;/a&gt; (&lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization.aspx#Downloads"&gt;download&lt;/a&gt;, &lt;a href="http://samples.infragistics.com/sldv/"&gt;samples&lt;/a&gt;) suite of controls, showcasing their advantages over toolbox controls. This blogpost takes a look at the use cases we considered when building this showcase, and describes the decisions made in terms of application structure, UI design, and UI controls to meet these requirements. If you&amp;rsquo;d like to learn more on how these controls are used using code segments from the application, take a look at &lt;a href="http://blogs.infragistics.com/blogs/kiril_matev/archive/2011/04/12/a-sample-sales-reporting-application-built-using-silverlight-4-0.aspx"&gt;this blogpost&lt;/a&gt;. Here&amp;rsquo;s a screenshot of the application:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/SalesAppScreenshot1.png"&gt;&lt;img src="http://blogs.infragistics.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/SalesAppScreenshot1.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Use Cases and UI component choice&lt;/h3&gt;
&lt;p&gt;1. In order to better plan production volumes, marketing activities and product discounts, users would like to be able to look at sales figures from a variety of different perspectives, looking for growth opportunities in accounts, sales regions, and products. In order to gain this kind of insight, the user has to browse aggregated views of invoice data, and to easily modify the dimensions along which these aggregations are computed. &lt;/p&gt;
&lt;p&gt;In order to meet the requirements of this use case and let users browse multidimensional data, we will use a &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-pivot-grid.aspx#Overview"&gt;XamPivotGrid&lt;/a&gt; control (&lt;a href="http://samples.infragistics.com/sldv/ComponentOverview.aspx?cn=pivot-grid"&gt;samples&lt;/a&gt;). The &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-pivot-grid.aspx#Overview"&gt;XamPivotGrid&lt;/a&gt; control implements pivoting functionality, supporting both flat (&lt;a href="http://samples.infragistics.com/sldv/RunSamples.aspx?cn=pivot-grid#/pivot-grid/flatdatasource-xaml"&gt;sample&lt;/a&gt;), or OLAP data sources (sample), and Excel-like interaction allowing users to easily modify the aggregation dimensions and measures. Please see a screenshot of the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-pivot-grid.aspx#Overview"&gt;XamPivotGrid&lt;/a&gt; below:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/SalesAppScreenshotPivot.png"&gt;&lt;img src="http://blogs.infragistics.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/SalesAppScreenshotPivot.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2. The user would like to easily modify customers&amp;rsquo; details, and would like to also be able to edit orders placed by each customer within the same UI. The user would like to sort and filter customer records, as well as edit the attributes of a customer or an order with input validation, preventing them from entering invalid data (such as a non-numeric value for an order freight charge). &lt;/p&gt;
&lt;p&gt;In order to meet this requirement, we will use a &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamwebgrid.aspx#Overview"&gt;XamGrid&lt;/a&gt; control. This control implements sorting (&lt;a href="http://samples.infragistics.com/sllob/RunSamples.aspx?cn=grid#/grid/sorting"&gt;sample&lt;/a&gt;), filtering (&lt;a href="http://samples.infragistics.com/sllob/RunSamples.aspx?cn=grid#/grid/filtering-data"&gt;sample&lt;/a&gt;)and supports the on-demand retrieval of hierarchical records and their presentation in tabular form (&lt;a href="http://samples.infragistics.com/sllob/RunSamples.aspx?cn=grid#/grid/handling-hierarchical-data-sets"&gt;sample&lt;/a&gt;), as well as rich data editing using specialized editors providing value formatting and validation (&lt;a href="http://samples.infragistics.com/sllob/RunSamples.aspx?cn=grid#/grid/editing-data"&gt;sample&lt;/a&gt;). Please see a screenshot of the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamwebgrid.aspx#Overview"&gt;XamGrid&lt;/a&gt; below:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/SalesAppScreenshotGrid2.png"&gt;&lt;img src="http://blogs.infragistics.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/SalesAppScreenshotGrid2.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;3. Users process the data they see in the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-pivot-grid.aspx#Overview"&gt;XamPivotGrid&lt;/a&gt;&amp;nbsp;and &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamwebgrid.aspx#Overview"&gt;XamGrid&lt;/a&gt;, either by printing, exporting it to Excel, or by adding and removing customers. The user would like to easily access these commonly used functions in an accessible location, visible at all times during their work with the application. &lt;/p&gt;
&lt;p&gt;We will use the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xam-web-ribbon.aspx#Overview"&gt;XamRibbon&lt;/a&gt; control (&lt;a href="http://samples.infragistics.com/sllob/ComponentOverview.aspx?cn=ribbon"&gt;samples&lt;/a&gt;)&amp;nbsp; to meet this requirement. It allows us to easily group related functionality in tabs and button groups (&lt;a href="http://samples.infragistics.com/sllob/RunSamples.aspx?cn=ribbon#/ribbon/add-tabs-and-groups"&gt;sample&lt;/a&gt;), and if appropriate to highlight relevant contextual functionality (&lt;a href="http://samples.infragistics.com/sllob/RunSamples.aspx?cn=ribbon#/ribbon/contextual-tab"&gt;sample&lt;/a&gt;). Please see a screenshot of the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xam-web-ribbon.aspx#Overview"&gt;XamRibbon&lt;/a&gt; below:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/SalesAppScreenshotRibbon.png"&gt;&lt;img src="http://blogs.infragistics.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/SalesAppScreenshotRibbon.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;4. One of the core requirements is to be able to view daily sales in a graphical way in order to see trends. The large volume of data requires an easy way of browsing it using zooming. Also, they would like to be able to easily see the sales value for any specific day, so they can then investigate what&amp;rsquo;s the product breakdown of that sale figure. Furthermore, they&amp;rsquo;d like to get a realistic expression of the sales volume over time, which filters out the noise from day to day differences in sales.&lt;/p&gt;
&lt;p&gt;Meeting this charting requirement is possible using the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-data-chart.aspx#Overview"&gt;XamDataChart&lt;/a&gt; control. This control binds quickly to high-volume data (&lt;a href="http://samples.infragistics.com/sldv/RunSamples.aspx?cn=data-chart#/data-chart/binding-high-volume-data"&gt;sample&lt;/a&gt;), and allows users to zoom in and out using the mouse. The &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-data-chart.aspx#Overview"&gt;XamDataChart&lt;/a&gt; implements tooltips (&lt;a href="http://samples.infragistics.com/sldv/RunSamples.aspx?cn=data-chart#/data-chart/chart-tooltips"&gt;sample&lt;/a&gt;) and trend lines (&lt;a href="http://samples.infragistics.com/sldv/RunSamples.aspx?cn=data-chart#/data-chart/series-trend-lines"&gt;sample&lt;/a&gt;) to enable users to easily see specific values as well as the overall trends and patterns in the data. Please see a screenshot of the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-data-chart.aspx#Overview"&gt;XamDataChart&lt;/a&gt; below:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/SalesAppScreenshotChart1.png"&gt;&lt;img src="http://blogs.infragistics.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/SalesAppScreenshotChart1.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Application Structure&lt;/h3&gt;
&lt;p&gt;As the application does not have strict performance requirements, and users would like to access the application remotely, it was built as a web application. The advanced data browsing capabilities it requires in the form of pivoting and charting led to the decision to use Silverlight, due to its rich interaction model, and its productivity as a development platform. The application uses an entity data model and RIA Services to make data available to the client. This approach was selected because of the ease with which it allows the data layer to be built.&lt;/p&gt;
&lt;h3&gt;UI structure&lt;/h3&gt;
&lt;p&gt;The relative isolation between the interactions required by different use cases allows us to simplify the UI by only presenting a single control at a time &amp;ndash; the user either browses invoice data, or edits customers and orders, or views daily sales data in a chart. The user interface of this sample application consists of a single form with a tab control, which contains the different views of the application in different tabs. Above the tab control, a &lt;a href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xam-web-ribbon.aspx#Overview"&gt;XamRibbon&lt;/a&gt; control contains buttons representing the most often performed tasks.&lt;/p&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;p&gt;This blogpost summarized the use cases covered by the &lt;a target="_blank" href="http://labs.infragistics.com/silverlightdv/Showcases/SalesReporting/"&gt;Sales Reporting showcase&lt;/a&gt;, and the rationale behind the choices made as to UI structure and components used. It provides an example of how Infragistics controls can be used to deliver a functional and richly interactive application to meet a certain set of requirements. Now that you&amp;rsquo;ve seen how easy it is to move from requirements to specific controls, and how to implement this, talk to your users and customers about these capabilities and find out how you can benefit from the advantages they provide. &lt;/p&gt;
&lt;p&gt;If you have any questions or comments, you can reach me at &lt;a href="mailto:kmatev@infragistics.com"&gt;kmatev@infragistics.com&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=323406" width="1" height="1"&gt;</content><author><name>kmatev</name><uri>http://www.infragistics.com/profile/MzAzNzk=</uri></author><category term="Data Visualization" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Data+Visualization/default.aspx" /><category term="zooming" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/zooming/default.aspx" /><category term="NetAdvantage for Silverlight Data Visualization" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/NetAdvantage+for+Silverlight+Data+Visualization/default.aspx" /><category term="Silverlight" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Silverlight/default.aspx" /><category term="Grid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Grid/default.aspx" /><category term="XamGrid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/XamGrid/default.aspx" /><category term="pivot grid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/pivot+grid/default.aspx" /><category term="trendline" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/trendline/default.aspx" /><category term="XamRibbon" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/XamRibbon/default.aspx" /><category term="Line of business" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Line+of+business/default.aspx" /><category term="RIA" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/RIA/default.aspx" /></entry><entry><title>Upgrading your charting experience using XamDataChart</title><link rel="alternate" type="text/html" href="/community/blogs/kiril_matev/archive/2011/11/10/upgrading-your-charting-experience-using-xamdatachart.aspx" /><id>/community/blogs/kiril_matev/archive/2011/11/10/upgrading-your-charting-experience-using-xamdatachart.aspx</id><published>2011-11-10T17:55:00Z</published><updated>2011-11-10T17:55:00Z</updated><content type="html">&lt;p&gt;&lt;a href="http://help.infragistics.com/NetAdvantage/WPFDV/2011.2/CLR4.0/?page=Developers_Guide_xamChart.html" target="_blank"&gt;XamChart&amp;nbsp;&lt;/a&gt;(samples no longer available as control has been retired since the 2012.1 release) is a charting control for Silverlight and WPF, available as a part of both the Line of business and Data Visualization products. With its support for interactive data browsing and a rich set of series, it has been a choice for a variety of charting scenarios for developers. However, to better handle scenarios with large amounts of data, and real-time data streams, the &lt;a href="http://help.infragistics.com/NetAdvantage/WPFDV/2011.1/CLR4.0/?page=Developers_Guide_xamDataChart.html"&gt;XamDataChart&lt;/a&gt;&amp;nbsp;(&lt;a target="_blank" href="http://www.infragistics.com/products/silverlight/data-chart"&gt;samples&lt;/a&gt;) was introduced. It adds zooming, tooltips and a considerable degree of series and axis customizations to enable developers to implement sophisticated charting functionality. So, what are the differences in using the &lt;a href="http://help.infragistics.com/NetAdvantage/WPFDV/2011.2/CLR4.0/?page=Developers_Guide_xamChart.html" target="_blank"&gt;XamChart&lt;/a&gt; and the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2013.1/CLR4.0/?page=xamDataChart_xamDataChart.html" target="_blank"&gt;XamDataChart&lt;/a&gt;? In this blogpost I&amp;rsquo;ll describe how to build simple charting scenarios using the &lt;a href="http://help.infragistics.com/NetAdvantage/WPFDV/2011.2/CLR4.0/?page=Developers_Guide_xamChart.html" target="_blank"&gt;XamChart&lt;/a&gt; and &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2013.1/CLR4.0/?page=xamDataChart_xamDataChart.html" target="_blank"&gt;XamDataChart&lt;/a&gt;, and what one needs to keep in mind when moving from the &lt;a href="http://help.infragistics.com/NetAdvantage/WPFDV/2011.2/CLR4.0/?page=Developers_Guide_xamChart.html" target="_blank"&gt;XamChart&lt;/a&gt; to the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2013.1/CLR4.0/?page=xamDataChart_xamDataChart.html" target="_blank"&gt;XamDataChart&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Using the XamChart&lt;/h3&gt;
&lt;p&gt;Please see below how to setup a &lt;a href="http://help.infragistics.com/NetAdvantage/WPFDV/2011.2/CLR4.0/?page=Developers_Guide_xamChart.html" target="_blank"&gt;XamChart&lt;/a&gt; with one line series:&lt;/p&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;p&gt;1. There are no axes declared &amp;ndash; these are automatically initialized according to the type of series&lt;/p&gt;
&lt;p&gt;used&lt;/p&gt;
&lt;p&gt;2. Series are specified using a single type &amp;ndash; the Series type. Different kinds of series are specified using the &lt;a href="http://help.infragistics.com/NetAdvantage/WPFDV/2011.1/CLR4.0/?page=InfragisticsWPF4.Chart.v11.1~Infragistics.Windows.Chart.Series~ChartType.html"&gt;ChartType&lt;/a&gt; property.&lt;/p&gt;
&lt;p&gt;3.&amp;nbsp; The &lt;a href="http://help.infragistics.com/NetAdvantage/WPFDV/2011.1/CLR4.0/?page=InfragisticsWPF4.Chart.v11.1~Infragistics.Windows.Chart.Series~DataMapping.html"&gt;DataMapping&lt;/a&gt; property sets the properties of the bound object to be used when initializing the chart series values&lt;/p&gt;
&lt;h3&gt;Using the XamDataChart&lt;/h3&gt;
&lt;p&gt;The &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2013.1/CLR4.0/?page=xamDataChart_xamDataChart.html" target="_blank"&gt;XamDataChart&lt;/a&gt; offers powerful ways to interact with data, such as zooming, trendlines and chart synchronization. In addition to all the types supported by the XamChart, &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2013.1/CLR4.0/?page=xamDataChart_xamDataChart.html" target="_blank"&gt;XamDataChart&lt;/a&gt; supports polar and radial series types. It enables developers not only visualize the data, but also enable users to interact with it. The &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2013.1/CLR4.0/?page=xamDataChart_xamDataChart.html" target="_blank"&gt;XamDataChart&lt;/a&gt; only supports 2D chart types, and chart types which do not require an axis, such as a pie, and funnel are implemented by separate controls - &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2013.1/CLR4.0/?page=xamPieChart.html" target="_blank"&gt;XamPieChart&lt;/a&gt;, &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2013.1/CLR4.0/?page=xamFunnelChart.html" target="_blank"&gt;XamFunnelChart&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So, how do you use the XamDataChart?&lt;/p&gt;
&lt;p&gt;1. Declare the axes (the XamDataChart supports string (CategoryXAxis, CategoryYAxis, CategoryAngleAxis), numeric (NumericXAxis, NumericYAxis, NumericRadiusAxis, NumericAngleAxis), and date (CategoryDateTimeAxis). In this case we&amp;rsquo;d like to have dates along the X axis, and numeric values along the Y axis, so we&amp;rsquo;re using the CategoryDateTimeXAxis and the NumericYAxis.&lt;/p&gt;
&lt;p&gt;2. Declare the series, referencing the two axes&lt;/p&gt;
&lt;p&gt;3. Declare a tooltip&lt;/p&gt;
&lt;p&gt;Declaring a line series in a XamDataChart is illustrated below:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;ig:LineSeries&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DateTimeMemberPath=&amp;quot;Date&amp;quot; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Label=&amp;quot;{}{Date:d}&amp;quot; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ItemsSource=&amp;quot;{Binding}&amp;quot;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;XAxis=&amp;quot;{Binding ElementName=xAxis}&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; YAxis=&amp;quot;{Binding ElementName=yAxis}&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ValueMemberPath=&amp;quot;Sales&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ItemsSource=&amp;quot;{Binding}&amp;quot; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TrendLineType=&amp;quot;ModifiedAverage&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TrendLineBrush=&amp;quot;Yellow&amp;quot;/&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;/p&gt;
&lt;h3&gt;Moving from XamChart to XamDataChart&lt;/h3&gt;
&lt;p&gt;If you&amp;rsquo;d like to move from the &lt;a href="http://help.infragistics.com/NetAdvantage/WPFDV/2011.2/CLR4.0/?page=Developers_Guide_xamChart.html" target="_blank"&gt;XamChart&lt;/a&gt; to using the &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2013.1/CLR4.0/?page=xamDataChart_xamDataChart.html" target="_blank"&gt;XamDataChart&lt;/a&gt; because of its richer interaction capabilities and series type support, here are a few things to note:&lt;/p&gt;
&lt;p&gt;1. The axes need to be declared and referenced in a series for it to be rendered&lt;/p&gt;
&lt;p&gt;2. Each series type is implemented by a separate series type, such as LineSeries, ColumnSeries, BubbleSeries&lt;/p&gt;
&lt;p&gt;3. The property of the bound object to be used for the chart series are specified using a member path property on the series&lt;/p&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;p&gt;The &lt;a href="http://help.infragistics.com/NetAdvantage/WPF/2013.1/CLR4.0/?page=xamDataChart_xamDataChart.html" target="_blank"&gt;XamDataChart&lt;/a&gt; is a powerful charting control, enabling users to browse and interact with data in a much richer way using zooming, inter-chart synchronization and tooltips. With a variety of series types and built-in trendlines, it&amp;rsquo;s fully capable of handing your charting scenarios. Talk to users of your applications and ask them where they can benefit from browsing their data in a visual say.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=314987" width="1" height="1"&gt;</content><author><name>kmatev</name><uri>http://www.infragistics.com/profile/MzAzNzk=</uri></author><category term="WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/WPF/default.aspx" /><category term="XamDataChart" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/XamDataChart/default.aspx" /><category term="chart" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/chart/default.aspx" /><category term="zooming" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/zooming/default.aspx" /><category term="panning" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/panning/default.aspx" /><category term="Silverlight" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Silverlight/default.aspx" /><category term="fast chart" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/fast+chart/default.aspx" /><category term="data analysis" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/data+analysis/default.aspx" /><category term="trendline" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/trendline/default.aspx" /></entry><entry><title>Using XamTimeline and XamDataChart to build an annotated view of your time-series data</title><link rel="alternate" type="text/html" href="/community/blogs/kiril_matev/archive/2011/07/28/using-xamtimeline-and-xamdatachart-to-build-an-annotated-view-of-your-time-series-data.aspx" /><id>/community/blogs/kiril_matev/archive/2011/07/28/using-xamtimeline-and-xamdatachart-to-build-an-annotated-view-of-your-time-series-data.aspx</id><published>2011-07-28T16:36:00Z</published><updated>2011-07-28T16:36:00Z</updated><content type="html">&lt;p&gt;WPF allows developers to build highly interactive UIs, enabling users to browse large data sets displayed in charts using hardware-accelerated panning and zooming. However, when you&amp;rsquo;re building UIs featuring charts, your users will often request to have annotations displayed together with quantitative data. Even though the fast charting component &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-data-chart.aspx#Overview" target="_blank"&gt;XamDataChart&lt;/a&gt; (available both in &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization.aspx"&gt;Silverlight &lt;/a&gt;and &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization.aspx"&gt;WPF&lt;/a&gt;), doesn&amp;rsquo;t at this time have annotations out of the box, you can do this using the guidance in this blogpost. It describes an approach to display annotations in the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-data-chart.aspx#Overview" target="_blank"&gt;XamDataChart&lt;/a&gt;, enabling you to integrate the quantitative and qualitative aspects of your data in a single screen. The approach is illustrated with a simple stock annotator containing a view showing the price of a stock, together with economy-level and company-level news shown using different templates (colors, fonts, styles) over the stock price.&amp;nbsp;Annotations can be added, edited and deleted using a&amp;nbsp;&lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview"&gt;XamDataGrid&lt;/a&gt; control provided below the chart control.&lt;/p&gt;
&lt;p&gt;Please download the &lt;a href="http://users.infragistics.com/kmatev/blog/xamtimelinexamchart/igstockannotator.zip" target="_blank"&gt;sample project&lt;/a&gt;. &lt;strong&gt;Please remember to &lt;a href="http://www.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.Tuning+the+XamDataChart+for+Blazing-Fast+Charting/unblockZIP.jpg"&gt;unblock the ZIP archive&lt;/a&gt; before extracting it. &lt;/strong&gt;The project is built using Visual Studio 2010 and .NET Framework 4. It includes early versions of the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-data-chart.aspx#Overview" target="_blank"&gt;XamDataChart&lt;/a&gt;, &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-timeline.aspx#Overview" target="_blank"&gt;XamTimeline&lt;/a&gt;, &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview"&gt;XamDataGrid&lt;/a&gt; 11.2 libraries, so you can build and run it without any additional downloads. &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf.aspx#Downloads"&gt;Fully-functional free 30-day trials&lt;/a&gt; of the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf.aspx#Overview"&gt;NetAdvantage for WPF Line of Business&lt;/a&gt; and &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-timeline.aspx#Downloads" target="_blank"&gt;NetAdvantage for WPF Data Visualization&lt;/a&gt; product are &lt;a href="http://www.infragistics.com/dotnet/netadvantage/ultimate.aspx#Downloads"&gt;available&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a screenshot of the chart with the annotations displayed:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.infragistics.com/community/cfs-filesystemfile.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/StockAnnotator.jpg" width="400" height="300" alt="" /&gt;&lt;/p&gt;
&lt;h3&gt;Why is this important&lt;/h3&gt;
&lt;p&gt;You would typically use a &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-data-chart.aspx#Overview" target="_blank"&gt;XamDataChart&lt;/a&gt; for presenting your quantitative time series data. The chart can &lt;a href="http://samples.infragistics.com/sldv/RunSamples.aspx?cn=data-chart#/data-chart/binding-high-volume-data"&gt;quickly present large volumes of data&lt;/a&gt;, &lt;a href="http://samples.infragistics.com/sldv/RunSamples.aspx?cn=data-chart#/data-chart/trendline-regression"&gt;build trendlines&lt;/a&gt;, &lt;a href="http://samples.infragistics.com/sldv/RunSamples.aspx?cn=data-chart#/data-chart/financial-indicators"&gt;financial indicators&lt;/a&gt;, and &lt;a href="http://samples.infragistics.com/sldv/ComponentOverview.aspx?cn=data-chart"&gt;many more&lt;/a&gt;. However, out of the box, it does not enable you to overlay your qualitative data on top of it. On the other hand, the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-timeline.aspx#Overview"&gt;XamTimeline&lt;/a&gt; is a control used for navigating a &lt;a target="_blank" href="http://samples.infragistics.com/sldv/ComponentOverview.aspx?cn=timeline"&gt;time series&lt;/a&gt;, which contains qualitative data. The approach described in this blog post combines the two to deliver both quantitative and qualitative data in the same control, allowing your users to see the data in context.&lt;/p&gt;
&lt;h3&gt;Approach specifics&lt;/h3&gt;
&lt;p&gt;The approach consists of the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-timeline.aspx#Overview"&gt;XamTimeline&lt;/a&gt; hosted in the plot area of the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-data-chart.aspx#Overview" target="_blank"&gt;XamDataChart&lt;/a&gt;. The&amp;nbsp;&lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-timeline.aspx#Overview"&gt;XamTimeline&lt;/a&gt;&amp;nbsp;has had a number of customizations applied to it to adapt it to this scenario:&lt;/p&gt;
&lt;p&gt;By default, the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-timeline.aspx#Overview"&gt;XamTimeline&lt;/a&gt; contains event panels both above and below the axis. In this case, the lower event panel is collapsed, together with the axis element.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-timeline.aspx#Overview"&gt;XamTimeline&lt;/a&gt;&amp;nbsp;event title style is set up to display the clicked annotation details in the textbox on the right.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-timeline.aspx#Overview"&gt;XamTimeline&lt;/a&gt;&amp;nbsp;details panel is set up to close when clicked, and to display the annotation details in the textbox on the right.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-timeline.aspx#Overview"&gt;XamTimeline&lt;/a&gt;&amp;nbsp;event point has been styled to display the annotation details in the textbox on the right when clicked.&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-timeline.aspx#Overview"&gt;XamTimeline&lt;/a&gt; minimum and maximum axis values are bound to the minimum and maximum values of the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-data-chart.aspx#Overview" target="_blank"&gt;XamDataChart&lt;/a&gt;. Zooming in the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-timeline.aspx#Overview"&gt;XamTimeline&lt;/a&gt; and the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-data-chart.aspx#Overview" target="_blank"&gt;XamDataChart&lt;/a&gt;&amp;nbsp;is synchronized using an outside &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-zoom-bar.aspx#Overview"&gt;XamZoombar&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Please refer to the source code for implementation details.&lt;/p&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;p&gt;This blog post presented an integration of the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-data-chart.aspx#Overview" target="_blank"&gt;XamDataChart&lt;/a&gt; with the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-timeline.aspx#Overview"&gt;XamTimeline&lt;/a&gt; control in order to combine quantitative with qualitative time series data. Using this combination, which comes without any extensive styling customizations, user-code or control extensions, you are able to build on what&amp;rsquo;s been possible up to this point using out of the box functionality. Take a look at the data you present in the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/data-visualization/xam-data-chart.aspx#Overview" target="_blank"&gt;XamDataChart&lt;/a&gt; &amp;ndash; if you do have any qualitative time-series data associated with it, and take advantage of the guidance presented here to integrate the two to enable your users to make decisions more quickly.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you have any questions or comments, you can reach me at&amp;nbsp;&lt;a href="mailto:kmatev@infragistics.com"&gt;kmatev@infragistics.com&lt;/a&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=296106" width="1" height="1"&gt;</content><author><name>kmatev</name><uri>http://www.infragistics.com/profile/MzAzNzk=</uri></author><category term="WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/WPF/default.aspx" /><category term="Data Visualization" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Data+Visualization/default.aspx" /><category term="XamDataChart" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/XamDataChart/default.aspx" /><category term="chart" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/chart/default.aspx" /><category term="NetAdvantage for Silverlight Data Visualization" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/NetAdvantage+for+Silverlight+Data+Visualization/default.aspx" /><category term="Silverlight" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Silverlight/default.aspx" /><category term="fast chart" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/fast+chart/default.aspx" /><category term="coloring" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/coloring/default.aspx" /></entry><entry><title>Optimizing Infragistics WPF Controls Startup Time</title><link rel="alternate" type="text/html" href="/community/blogs/kiril_matev/archive/2011/07/07/optimizing-infragistics-wpf-controls-startup-time.aspx" /><id>/community/blogs/kiril_matev/archive/2011/07/07/optimizing-infragistics-wpf-controls-startup-time.aspx</id><published>2011-07-07T17:15:00Z</published><updated>2011-07-07T17:15:00Z</updated><content type="html">&lt;p&gt;The XAML platform allows us to deliver controls offering much richer interaction and flexibility when compared against Windows Forms. However, the many complex controls and elaborate themes, can increase the initial start up time in WPF applications, demanding specific attention to ensuring that users don&amp;rsquo;t have to wait when opening a form. One way to improve initial loading time of forms is to preload complex controls and themes they are using. This approach to improving initial startup time is illustrated in this blog post. If you&amp;#39;d like to learn about&amp;nbsp;&lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt;&amp;nbsp;performance optimization in terms of rendering and scrolling speed, please see &lt;a target="_blank" href="http://blogs.infragistics.com/blogs/kiril_matev/archive/2010/10/26/optimizing-xamdatagrid-performance.aspx"&gt;this post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The approach consists of opening on a different thread a window containing the components you will be using in your application, which is not shown to the user. The initialization of this window causes the control code to be JIT-ted, theme references to be resolved, and their definitions loaded. Once this CLR housekeeping work is done, subsequent initializations of the pre-loaded controls are significantly faster.&lt;/p&gt;
&lt;p&gt;Please download the &lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.Optimizing+Infragistics+WPF+Controls+Startup+Time/XamDataGridInitialLoadingTimeOptimization5.zip" target="_blank"&gt;sample project&lt;/a&gt;. &lt;strong&gt;Please remember to &lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.Tuning+the+XamDataChart+for+Blazing-Fast+Charting/unblockZIP.jpg" target="_blank"&gt;unblock the ZIP archive&lt;/a&gt; before extracting it. &lt;/strong&gt;The project is built using Visual Studio 2010 and .NET Framework 4. It includes trial versions of the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; 11.1 libraries, so you can build and run it without any additional downloads. A &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf.aspx#Downloads" target="_blank"&gt;fully-functional free 30-day trial&lt;/a&gt; of the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf.aspx#Overview" target="_blank"&gt;NetAdvantage for WPF Line of Business&lt;/a&gt; product is &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf.aspx#Downloads" target="_blank"&gt;available&lt;/a&gt;. Below are screenshots of the project comparing initialization and rendering times with and without preloading, which illustrates the impact of preloading on initial startup time:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/PreloadedTimes.jpg"&gt;&lt;img src="http://blogs.infragistics.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/PreloadedTimes.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/NonPreloadedTimes.jpg"&gt;&lt;img src="http://blogs.infragistics.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/NonPreloadedTimes.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Sample Project UI&lt;/h3&gt;
&lt;p&gt;Running the sample opens two windows &amp;ndash; the preload window, and the main&amp;nbsp;window. The main window displays the amount of time the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; window took to initialize and render. It also contains a button, allowing you to launch additional &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt; windows. &lt;/p&gt;
&lt;h3&gt;How to use this sample&lt;/h3&gt;
&lt;p&gt;You can see the effect of preloading, by toggling it on and off using the value of the IsPreloaded property, defined in App.xaml.cs. By default it is set to true, causing the hidden window to be initialized and opened at application startup, thus preloading its contents &amp;ndash; in this case the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt;,&amp;nbsp;&lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamRibbon.aspx#Overview" target="_blank"&gt;XamRibbon&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdockmanager.aspx#Overview" target="_blank"&gt;XamDockManager&lt;/a&gt;. Set it to false and observe the much longer initial loading time. Click on the button in the form to launch additional windows, containing a &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamRibbon.aspx#Overview" target="_blank"&gt;XamRibbon&lt;/a&gt;,&amp;nbsp;&lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdockmanager.aspx#Overview" target="_blank"&gt;XamDockManager&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt;&amp;nbsp;bound to sample data. The performance benefit is visible in the first invocation, as subsequent invocations use the code JIT-ted during the first invocation.&lt;/p&gt;
&lt;p&gt;Please note that in case IsPreloaded is set to false, the first window takes substantially more time to open than any subsequently open grid window. This is because the first time a &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;t&lt;/a&gt;ype is loaded, it has to JIT the MSIL, locate and load theme resources, and so on. This is actually what the hidden preloading window does (when the IsPreloaded property is set to true) &amp;ndash; it causes the pre-JIT-ting of MSIL for controls shown int the window,&amp;nbsp;ensuring that when the user actually opens a window containing the same controls, the window will appear much faster, because it can reuse the already JIT-ted code of these controls.&lt;/p&gt;
&lt;h3&gt;Approach Description&lt;/h3&gt;
&lt;p&gt;The application opens a window, which isn&amp;rsquo;t displayed to the user, because it&amp;rsquo;s shown outside of the bounds of the screen. This window contains controls that will be preloaded, and will subsequently be loaded significantly faster in other screens in the same application. Only controls appearing in the preload window will subsequently have a smaller initial loading time, i.e. unless you preload a component, its initial start up time will not decrease. A significant amount of the initial loading time is due to resolving and loading themes. This is why it&amp;#39;s important to have the preload controls theme set to the same theme you&amp;#39;ll be using them with in your application. In this sample, the &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt;,&amp;nbsp;&lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamRibbon.aspx#Overview" target="_blank"&gt;XamRibbon&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdockmanager.aspx#Overview" target="_blank"&gt;XamDockManager&lt;/a&gt;&amp;nbsp;appear in the preload window, but depending on the controls you are using, you may wish to include them into the preload window, so they can have a smaller initial start up time in your application. Most often, you&amp;rsquo;d want to preload complex controls such as&amp;nbsp;&lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt;,&amp;nbsp;&lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdockmanager.aspx#Overview" target="_blank"&gt;XamDockManager&lt;/a&gt;, &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/tiles-control.aspx#Overview" target="_blank"&gt;XamTilesControl&lt;/a&gt;, &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamRibbon.aspx#Overview" target="_blank"&gt;XamRibbon&lt;/a&gt; and &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/schedule.aspx#Overview" target="_blank"&gt;XamSchedule&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Preload Window Architectural Implications&lt;/h3&gt;
&lt;p&gt;This approach only speeds up the first rendering of the preloaded controls. In doing so, it adds to the structural complexity of your application, so you need to carefully consider its implications before adopting it. The preload window is initialized, opened and closed in the OnStartup event handler in App.xaml.cs. You might want to move it together with the rest of your application start-up code (authentication operations to servers, loading presisted data, etc). It uses a separate thread to open the window, in order to minimize the time your system spends initializing. Please consider the implications of the approach for your application before using it.&lt;/p&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;p&gt;In this blog post we looked at how to preload complex components in order to improve the initial loading time. For runtime related performance optimizations, please see my blogposts on &lt;a href="http://blogs.infragistics.com/blogs/kiril_matev/archive/2010/10/26/optimizing-xamdatagrid-performance.aspx" target="_blank"&gt;XamDataGrid performance optimization&lt;/a&gt; and &lt;a href="http://blogs.infragistics.com/blogs/kiril_matev/archive/2011/04/07/tuning-the-xamdatachart-for-blazing-fast-charting.aspx" target="_blank"&gt;XamDataChart real-time data performance optimization&lt;/a&gt;. In conjunction with this post, this advice would allow you to present your users with an application featuring complex controls such as &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdatagrid.aspx#Overview" target="_blank"&gt;XamDataGrid&lt;/a&gt;, &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamRibbon.aspx#Overview" target="_blank"&gt;XamRibbon&lt;/a&gt;, &lt;a href="http://www.infragistics.com/dotnet/netadvantage/wpf/xamdockmanager.aspx#Overview" target="_blank"&gt;XamDockManager&lt;/a&gt; that&amp;rsquo;s not only functional and visually appealing, but also with a short initial loading time. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=292910" width="1" height="1"&gt;</content><author><name>kmatev</name><uri>http://www.infragistics.com/profile/MzAzNzk=</uri></author><category term="WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/WPF/default.aspx" /><category term="Grid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Grid/default.aspx" /><category term="XamDataGrid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/XamDataGrid/default.aspx" /><category term="Performance" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Performance/default.aspx" /><category term="Visual Studio 2010" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Visual+Studio+2010/default.aspx" /><category term="theme" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/theme/default.aspx" /><category term="settings" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/settings/default.aspx" /><category term="NetAdvantage for WPF" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/NetAdvantage+for+WPF/default.aspx" /></entry><entry><title>A Sample Sales Reporting Application Built Using Silverlight</title><link rel="alternate" type="text/html" href="/community/blogs/kiril_matev/archive/2011/04/12/a-sample-sales-reporting-application-built-using-silverlight-4-0.aspx" /><id>/community/blogs/kiril_matev/archive/2011/04/12/a-sample-sales-reporting-application-built-using-silverlight-4-0.aspx</id><published>2011-04-12T16:57:00Z</published><updated>2011-04-12T16:57:00Z</updated><content type="html">&lt;p&gt;Many customers are choosing Silverlight for building line of business applications because of the productivity of the platform and the rich interaction it enables. We offer fully-featured products in the Silverlight area, including &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/line-of-business.aspx#Overview"&gt;standard line of business controls&lt;/a&gt; such as a &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamwebgrid.aspx#Overview"&gt;grid&lt;/a&gt;, &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamwebmenu.aspx#Overview"&gt;menu&lt;/a&gt;, &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xam-web-ribbon.aspx#Overview"&gt;ribbon&lt;/a&gt;, &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamweboutlookbar.aspx#Overview"&gt;outlook bar&lt;/a&gt;, &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xam-web-chart.aspx#Overview"&gt;chart&lt;/a&gt;, &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/schedule.aspx#Overview"&gt;scheduler&lt;/a&gt;, as well as &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization.aspx#Overview"&gt;data visualization controls&lt;/a&gt; such as a &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-data-chart.aspx#Overview"&gt;chart&lt;/a&gt;, &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xamwebmap.aspx#Overview"&gt;map&lt;/a&gt;, &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-pivot-grid.aspx#Overview"&gt;pivot grid&lt;/a&gt;, among others. Recognizing the interest among developers toward this platform we held the &lt;a target="_blank" href="https://www119.livemeeting.com/cc/gc_pro_namewreg_infragistics/view?id=BDTKW8&amp;amp;pw=8dr%7E%7E%3EW"&gt;Building Data Access Applications using the Silverlight Data Grid&lt;/a&gt;, where I introduced a sample business reporting application, built using our products. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;UPDATE:&amp;nbsp;&lt;/b&gt;&lt;span style="font-weight:bold;"&gt;A recording of the webinar is &lt;/span&gt;&lt;a style="font-weight:bold;" href="https://www119.livemeeting.com/cc/gc_pro_namewreg_infragistics/view?id=BDTKW8&amp;amp;pw=8dr%7E%7E%3EW" target="_blank"&gt;now available&lt;/a&gt;&lt;span style="font-weight:bold;"&gt;. The application is now available &lt;/span&gt;&lt;a style="font-weight:bold;" target="_blank" href="http://labs.infragistics.com/silverlightdv/Showcases/SalesReporting/"&gt;here&lt;/a&gt;&lt;span style="font-weight:bold;"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This blogpost presents how this sample is built, and highlights certain features which you may find valuable in your applications. The sample project is &lt;a target="_blank" href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.A+Sample+Sales+Reporting+application+Built+Using+Silverlight+4/InfragisticsDemoApplication.zip"&gt;available for download&lt;/a&gt;. &lt;strong&gt;Please remember to &lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev.Tuning+the+XamDataChart+for+Blazing-Fast+Charting/unblockZIP.jpg" target="_blank"&gt;unblock the ZIP archive&lt;/a&gt; before extracting it. &lt;/strong&gt;It is built based on Silverlight and Visual Studio 2010, and uses &lt;a target="_blank" href="http://www.silverlight.net/getstarted/riaservices/"&gt;RIA services&lt;/a&gt; for exposing data to the Silverlight application. The downloadable package includes trial versions of the &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/line-of-business.aspx#Overview"&gt;NetAdvantage for Silverlight&lt;/a&gt; product libraries it needs to run, so no extra downloads are required to run this sample. Free fully functional trials are available of the &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/line-of-business.aspx#Downloads"&gt;line of busines&lt;/a&gt; and &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization.aspx#Downloads"&gt;data visualization&lt;/a&gt; products. Here&amp;rsquo;s a screenshot of the application when run:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/SalesAppScreenshotGrid.png"&gt;&lt;img src="http://blogs.infragistics.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/SalesAppScreenshotGrid.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Setting up the sample&lt;/h3&gt;
&lt;p&gt;Even if you do not have the resources to fully setup the data tier of this application, its source code would be valuable to you, because it demonstrates the features, interoperability and styling of key controls in the NetAdvantage for Silverlight Line of Business and Data Visualization products.&lt;/p&gt;
&lt;p&gt;Before you run the application, you need to setup a connection the Northwind database on a database server. You most probably have an SQL Express installed together with Visual Studio 2010, which you can use to host the Northwind database, which is &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/ms227484(v=vs.90).aspx"&gt;freely available&lt;/a&gt;. Once the Northwind database is setup in your database server, you need to set the database server setting in the web.config file of the InfragisticsDemoApplication.Web project. Once you open the web.config file, please locate the &amp;lt;connectionStrings&amp;gt; element, and make sure that in the element inside, you set the path to the database server instead of the &lt;strong&gt;MYCOMPUTER\SQLEXPRESS &lt;/strong&gt;text in the string below.&lt;/p&gt;
&lt;pre&gt;&amp;lt;add name=&amp;quot;NorthwindEntities&amp;quot; &lt;/pre&gt;
&lt;pre&gt;connectionString=&amp;quot;metadata=res://*/ClientBin.NorthwindEntities.csdl|res://*/ClientBin.NorthwindEntities.ssdl|res://*/ClientBin.NorthwindEntities.msl;provider=System.Data.SqlClient;provider connection string=&amp;amp;quot;data source=&lt;strong&gt;MYCOMPUTER\SQLEXPRESS&lt;/strong&gt;;initial catalog=Northwind;integrated security=True;multipleactiveresultsets=True;App=EntityFramework&amp;amp;quot;&amp;quot; providerName=&amp;quot;System.Data.EntityClient&amp;quot; /&amp;gt;&lt;/pre&gt;
&lt;h3&gt;Using XamRibbon&lt;/h3&gt;
&lt;p&gt;The &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xam-web-ribbon.aspx#Overview"&gt;XamRibbon&lt;/a&gt; is setup using two tabs, with three button groups, each containing button tools. This is fairly easy to setup using the code below, setting up a single tab with one button group, containing two buttons:&lt;/p&gt;
&lt;pre&gt;&amp;lt;ig:XamRibbon Name=&amp;quot;XamRibbon1&amp;quot; Grid.Row=&amp;quot;0&amp;quot;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;  &amp;lt;ig:XamRibbon.Tabs&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;     &amp;lt;ig:XamRibbonTabItem Header=&amp;quot;Home&amp;quot; &amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;        &amp;lt;ig:XamRibbonGroup Caption=&amp;quot;Customers&amp;quot; x:Name=&amp;quot;customersGroup&amp;quot;&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;      &amp;nbsp;&amp;nbsp;  &amp;lt;ig:ButtonTool x:Name=&amp;quot;btnAddUser&amp;quot; Caption=&amp;quot;Add Customer&amp;quot; LargeImage=&amp;quot;../Images/UsersAdd.png&amp;quot; &lt;br /&gt;              Click=&amp;quot;btnAddUser_Click&amp;quot; /&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;ig:ButtonTool x:Name=&amp;quot;btnRemoveUser&amp;quot; LargeImage=&amp;quot;../Images/UsersDelete.png&amp;quot; Caption=&amp;quot;Delete Customer&amp;quot; &lt;br /&gt;              Click=&amp;quot;btnRemoveUser_Click&amp;quot; /&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/ig:XamRibbonGroup&amp;gt;&lt;br /&gt;     &amp;lt;/ig:XamRibbonTabItem&amp;gt;&lt;br /&gt; &amp;nbsp;&amp;lt;/ig:XamRibbon.Tabs&amp;gt;&lt;br /&gt;&amp;lt;/ig:XamRibbon&amp;gt;&lt;/pre&gt;
&lt;h3&gt;Setting up XamGrid and implementing CRUD&lt;/h3&gt;
&lt;p&gt;The UI is built using a TabControl which hosts a number of &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamwebgrid.aspx#Overview"&gt;XamGrids&lt;/a&gt; and a &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-pivot-grid.aspx#Overview"&gt;XamPivotGrid&lt;/a&gt;. An Entity Data Model was generated for the tables in the Northwind table, together with a DomainService which exposes this data and handles committing any changes made by the Silverlight application. Once a DomainService is setup, code is automatically generated on the client to communicate with the service. This causes the entities exposed by the DomainService to appear in the Data Sources snap-in in Visual Studio. Within the Silverlight application, the &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamwebgrid.aspx#Overview"&gt;XamGrids&lt;/a&gt; were setup by dragging the corresponding table from the Data Sources snap-in into the design surface of the form. This sets up a &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamwebgrid.aspx#Overview"&gt;XamGrid&lt;/a&gt; (a more detailed walkthrough of this scenario is &lt;a target="_blank" href="http://blogs.infragistics.com/blogs/mihail_mateev/archive/2010/06/07/using-the-infragistics-xamgrid-with-ria-services.aspx"&gt;available&lt;/a&gt;) in the form, bound to data from the corresponding entity in the model.&lt;/p&gt;
&lt;p&gt;In addition to hierarchical data and CRUD, the &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamwebgrid.aspx#Overview"&gt;XamGrids &lt;/a&gt;in the sample also demonstrate filtering, selection, summaries and conditional formatting behaviors. Please take a look at the code for implementation details.&lt;/p&gt;
&lt;h4&gt;Binding to Hierachical Data&lt;/h4&gt;
&lt;p&gt;Binding to Hierarchical data is implemented in the Customers grid, which also shows the Order items for each customer. The approach uses a separate operation in the DomainService class, which retrieves customers together with associated Order objects. A detailed walkthrough of how to implement this is &lt;a target="_blank" href="http://blogs.infragistics.com/blogs/mihail_mateev/archive/2010/06/17/using-the-infragistics-xamgrid-and-xamdatachart-with-hierarchical-data-and-wcf-ria-services-part1.aspx"&gt;available&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;Implementing CRUD&lt;/h4&gt;
&lt;p&gt;Once the &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamwebgrid.aspx#Overview"&gt;XamGrids&lt;/a&gt; have been bound and record adding, editing and deleting has been enabled using row-based editing by setting the &lt;em&gt;EditingSettings&lt;/em&gt; &lt;em&gt;AllowEditing &lt;/em&gt;property to &lt;em&gt;Row&lt;/em&gt;, we implement CRUD operations by handling the &lt;em&gt;&lt;a target="_blank" href="http://help.infragistics.com/NetAdvantage/Silverlight/2010.3/CLR4.0/?page=InfragisticsSL4.Controls.Grids.XamGrid.v10.3~Infragistics.Controls.Grids.XamGrid~RowDeleted_EV.html"&gt;RowDeleted&lt;/a&gt; &lt;/em&gt;and &lt;em&gt;&lt;a target="_blank" href="http://help.infragistics.com/NetAdvantage/Silverlight/2010.3/CLR4.0/?page=InfragisticsSL4.Controls.Grids.XamGrid.v10.3~Infragistics.Controls.Grids.XamGrid~RowExitedEditMode_EV.html"&gt;RowExitedEditMode&lt;/a&gt; &lt;/em&gt;(called when a row was edited, as well as added) events. A detailed walkthrough of data editing in the &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamwebgrid.aspx#Overview"&gt;XamGrid&lt;/a&gt; is &lt;a target="_blank" href="http://help.infragistics.com/NetAdvantage/Silverlight/2010.3/CLR4.0/?page=SL_xamGrid_Editing_Data.html"&gt;available&lt;/a&gt;.The code in the handlers of these events calls the &lt;em&gt;SubmitChanges &lt;/em&gt;method of the &lt;em&gt;customerDomainDataSuurce, &lt;/em&gt;which commits changes made in the UI down to the database:&lt;/p&gt;
&lt;pre&gt;private void customerXamGrid_RowExitedEditMode(object sender, EditingRowEventArgs e)
{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;               //commit to the database changes made during a row add or row edit&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;               customerDomainDataSource.SubmitChanges();
}
 
private void customerXamGrid_RowDeleted(object sender, RowEventArgs e)
{
               //commit to the database deleted rows&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;               customerDomainDataSource.SubmitChanges();
}&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;Charting&lt;/h3&gt;
&lt;p&gt;The sample uses two of the charts we&amp;rsquo;re offering &amp;ndash; &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xamwebchart.aspx#Overview"&gt;XamWebChart&lt;/a&gt; and &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-data-chart.aspx#Overview"&gt;XamDataChart&lt;/a&gt;. They present sales data in dialog windows, which can be opened using the buttons in the ribbon. The charts have been bound to data from DomainService, including a breakdown of sales by product using an animated pie chart (using the &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xamwebchart.aspx#Overview"&gt;XamWebChart&lt;/a&gt;), and a timeline of sales over more than two years (using the &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-data-chart.aspx#Overview"&gt;XamDataChart&lt;/a&gt;). The &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-data-chart.aspx#Overview"&gt;XamDataChart&lt;/a&gt; also has a trendline added, as well as a &lt;a target="_blank" href="http://help.infragistics.com/NetAdvantage/WPFDV/2010.3/CLR4.0/?page=xamDataChart_Chart_Tooltips.html"&gt;tooltip&lt;/a&gt;, allowing the user to easily see the values and dates when spikes in sales occur. The &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-data-chart.aspx#Overview"&gt;XamDataChart&lt;/a&gt; also has enabled horizontal zooming, allowing a business user to easily narrow down their analysis of the sales data. Please see how these charts are declared for details on how these features are implemented. Here&amp;#39;s a screenshot of the daily sales chart:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/SalesAppScreenshotChart.png"&gt;&lt;img src="http://blogs.infragistics.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/SalesAppScreenshotChart.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Data Pivoting&lt;/h3&gt;
&lt;p&gt;The sample includes a &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-pivot-grid.aspx#Overview"&gt;pivot grid component&lt;/a&gt;, which is included in our &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization.aspx#Overview"&gt;NetAdvantage for Silverlight Data Visualization&lt;/a&gt; product. Using a data selector component, showing all the available dimensions and measures, the user can easily setup their own view of the data, using the familiar Excel-type of pivot table interface. In this case, the pivot grid is used to interactively slice and dice Invoice data from the Northwind database. Here&amp;#39;s a screenshot of the pivot grid view:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.infragistics.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/SalesAppScreenshot.png"&gt;&lt;img src="http://blogs.infragistics.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/kiril_5F00_matev/SalesAppScreenshot.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Theming&lt;/h3&gt;
&lt;p&gt;All the Infragistics controls in the sample have been styled using the Office 2010 Blue theme using resource dictionaries, included in the sample. These resource dictionaries are added in the App.xaml file which makes these styles available across the application. The Office 2010 Blue theme is available for all our controls in all our products.&lt;/p&gt;
&lt;h3&gt;Printing&lt;/h3&gt;
&lt;p&gt;Printing is implemented using the standard Silverlight 4 printing. Pressing the print button prints the grid control in the currently active tab, including the pivot grid.&lt;/p&gt;
&lt;h3&gt;Excel Export&lt;/h3&gt;
&lt;p&gt;Excel export is provided for the grid control in the currently active tab. Excel export is implemented for both &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamwebgrid.aspx#Overview"&gt;XamGrid&lt;/a&gt; and &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-pivot-grid.aspx#Overview"&gt;XamPivotGrid&lt;/a&gt; in a separate ExcelExporter class.&lt;/p&gt;
&lt;h3&gt;Summary&lt;/h3&gt;
&lt;p&gt;This blogpost describes a sample business reporting system built upon Silverlight. It presents how grids, charts and a pivot grid are used to deliver a rich user experience, offering interactive data browsing (&lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-pivot-grid.aspx#Overview"&gt;XamPivotGrid&lt;/a&gt; and &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/data-visualization/xam-web-data-chart.aspx#Overview"&gt;XamDataChart&lt;/a&gt;), CRUD operations and hierarchical data in a &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/xamwebgrid.aspx#Overview"&gt;XamGrid&lt;/a&gt;, printing, excel export in an application themed using the Office 2010 blue theme. This sample gives you a basic scenario of how you can use Silverlight and &lt;a target="_blank" href="http://www.infragistics.com/dotnet/netadvantage/silverlight/line-of-business.aspx#Overview"&gt;NetAdvantage for Silverlight suite of products&lt;/a&gt; to quickly build a functional and visually-appealing business application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.infragistics.com/community/aggbug.aspx?PostID=280438" width="1" height="1"&gt;</content><author><name>kmatev</name><uri>http://www.infragistics.com/profile/MzAzNzk=</uri></author><category term="Data Visualization" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Data+Visualization/default.aspx" /><category term="XamDataChart" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/XamDataChart/default.aspx" /><category term="chart" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/chart/default.aspx" /><category term="zooming" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/zooming/default.aspx" /><category term="panning" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/panning/default.aspx" /><category term="NetAdvantage for Silverlight Data Visualization" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/NetAdvantage+for+Silverlight+Data+Visualization/default.aspx" /><category term="Silverlight" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Silverlight/default.aspx" /><category term="Grid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Grid/default.aspx" /><category term="XamGrid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/XamGrid/default.aspx" /><category term="conditional formatting" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/conditional+formatting/default.aspx" /><category term="hierarchical data analysis" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/hierarchical+data+analysis/default.aspx" /><category term="pivot grid" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/pivot+grid/default.aspx" /><category term="data analysis" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/data+analysis/default.aspx" /><category term="XamRibbon" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/XamRibbon/default.aspx" /><category term="Line of business" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Line+of+business/default.aspx" /><category term="theming" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/theming/default.aspx" /><category term="RIA" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/RIA/default.aspx" /><category term="database server data" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/database+server+data/default.aspx" /><category term="Entity Data Model" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Entity+Data+Model/default.aspx" /><category term="styling" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/styling/default.aspx" /><category term="Visual Studio 2010" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/Visual+Studio+2010/default.aspx" /><category term="data binding" scheme="http://www.infragistics.com/community/blogs/kiril_matev/archive/tags/data+binding/default.aspx" /></entry></feed>