<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Intersoft Solutions Corporate Blog &#187; UXGridView</title>
	<atom:link href="http://blog.intersoftsolutions.com/tag/uxgridview/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.intersoftsolutions.com</link>
	<description>All about development productivity – ASP.NET, Silverlight, WPF, iOS, Android, Windows Phone, Windows 8</description>
	<lastBuildDate>Sat, 21 Apr 2018 06:57:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.33</generator>
	<item>
		<title>UXGridView RC Adds MVVM Data Exporting, Multi Aggregates, Selectors, and more</title>
		<link>http://blog.intersoftsolutions.com/2011/03/uxgridview-rc-adds-mvvm-data-exporting-multi-aggregates-selectors-and-more/</link>
		<comments>http://blog.intersoftsolutions.com/2011/03/uxgridview-rc-adds-mvvm-data-exporting-multi-aggregates-selectors-and-more/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 03:16:32 +0000</pubDate>
		<dc:creator><![CDATA[Jimmy Petrus]]></dc:creator>
				<category><![CDATA[2011 R1]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[ClientUI]]></category>
		<category><![CDATA[DevForce]]></category>
		<category><![CDATA[Release Candidate]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[UXGridView]]></category>
		<category><![CDATA[WCF RIA Services]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">https://intersoftpt.wordpress.com/2011/03/22/uxgridview-rc-adds-mvvm-data-exporting-multi-aggregates-selectors-and-more/</guid>
		<description><![CDATA[After going through a series of technology preview releases,  UXGridView is finally topping off with the complete feature sets. Today, I’m excited to announce the immediate availability of UXGridView Release Candidate. In case you missed the stories, UXGridView is Intersoft’s brand-new data grid built to [...]]]></description>
				<content:encoded><![CDATA[<img width="454" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2014/09/image_thumb111-588x350.png" class="attachment-post-thumbnail wp-post-image" alt="Exporting user interface" style="float:right; margin:0 0 10px 10px;" /><p>After going through a series of <a href="http://intersoftpt.wordpress.com/tag/uxgridview/">technology preview releases</a>,  UXGridView is finally topping off with the complete feature sets. Today, I’m excited to announce the immediate availability of UXGridView Release Candidate.</p>
<p>In case you missed the stories, UXGridView is Intersoft’s brand-new data grid built to handle the most demanding line-of-business development requirements – from server-side paging and filtering support, data editing and validation, batch update to data aggregates and data exporting. Each feature is thoughtfully engineered to work best with MVVM pattern implementation. UXGridView runs on both Silverlight and WPF with single identical markups. Learn more about UXGridView <a href="http://intersoftpt.wordpress.com/tag/uxgridview/">here</a>.</p>
<p>In this post, I will share the key highlights of the new features implemented in the UXGridView RC. As defined in the roadmap that I posted in my <a href="http://intersoftpt.wordpress.com/2011/02/07/introducing-uxgridview-the-mvvm-ready-grid-for-silverlight-and-wpf/">blog post</a>, the RC milestone will include advanced data-centric features such as data exporting, row virtualization improvements, multi aggregates, custom grouping logics, and a bunch of style selectors and template selectors.</p>
<h2>Data Exporting the MVVM-way</h2>
<p>In the previous CTPs, you have learned how UXGridView handles real-world data access scenarios like <a href="http://intersoftpt.wordpress.com/2011/02/07/introducing-uxgridview-the-mvvm-ready-grid-for-silverlight-and-wpf/">paging</a>, <a href="http://intersoftpt.wordpress.com/2011/02/09/uxgridview-part-ii-data-access-the-mvvm-way-with-querydescriptor/">filtering</a>, <a href="http://intersoftpt.wordpress.com/2011/02/21/uxgridview-ctp2-mvvm-data-editing/">data validation and editing</a> – all implemented entirely with MVVM design pattern. In this RC release, UXGridView adds data exporting capability which you can implement using the solid MVVM pattern. Unlike other grids, the data exporting in UXGridView supports both server-side and client-side mode. The most advanced mode is the server-side data exporting which allows you to export all rows in the data source even though the UXGridView is paged.</p>
<p>Just because UXGridView supports displaying millions of rows, that doesn’t mean you should. In real-world scenarios, most users browse and look only for a piece of data at a time. So in most cases, you would enable the server-side paging in the UXGridView so it loads only a subset of data at a time. For instances, a Grid with the page size set to 20 will load only 20 rows per page. The data exporting, quite the opposite, requires all data to be fetched before the exporting can execute. That’s one of the key challenges that we managed to address in UXGridView, enabling data exporting to work in harmony with the server paging and other features using the MVVM pattern implementation.</p>
<p>To handle the server-side data operation consistently, we built the data exporting upon the same key component that powers the server paging and filtering, the QueryDescriptor. Perhaps you still recall, QueryDescriptor encapsulates the query definitions which consisted of FilterDescriptors, SortDescriptors and PageDescriptor. That’s just perfect because we can simply use the existing instance of the QueryDescriptor in the ViewModel, and perform re-query that doesn’t include the paging descriptor. If you need a refresh on QueryDescriptor, please head to <a href="http://intersoftpt.wordpress.com/2011/02/09/uxgridview-part-ii-data-access-the-mvvm-way-with-querydescriptor/">Data-access the MVVM-way</a>.</p>
<p>The best way to handle the data exporting using MVVM is to implement a DelegateCommand in the ViewModel and bind it to the <strong>ExportCommand</strong>, a new command property introduced in the RC release. In the Executed handler, you call a server query that returns complete data, and finally pass it to the collection in the ViewModel which is bound to the <strong>ExportItems</strong> property of UXGridView. Take a look at the following code snippet to learn how it’s done.</p><pre class="crayon-plain-tag">public class ServerExportingViewModel : ServerSideOperationViewModel
{
    public ServerExportingViewModel()
        : base()
    {
        this.CanUserExport = true;
        this.ExportCommand = new DelegateCommand(ExecuteExportCommand);
    }

    public void ExecuteExportCommand(object parameter)
    {
        QueryDescriptor <strong>exportQueryDescriptor</strong> =
                     this.QueryDescriptor.<strong>CreateCopy</strong>(true, true, false);

        this.ProductsSource.GetData
        (
            <strong>exportQueryDescriptor</strong>,
            (products) =&gt;
            {
                PagedCollectionView current =
                                   this.Products as PagedCollectionView;
                PagedCollectionView exportedItems =
                                   new PagedCollectionView(products);                    

                exportedItems.<strong>CopyDefinitionsFrom</strong>(current, true,
                                   false, false, false);

                this.ExportItems = <strong>exportedItems</strong>;
            },
            (totalItemCount) =&gt;
            {

            },
            (error) =&gt;
            {

            }
        );
    }
}</pre><p>Quite simple and straightforward, isn’t it? Also notice that the QueryDescriptor now has a <strong>CreateCopy</strong>, a new time-saving method that returns a clone based on the given source and options. The most important point here is the flexibility that UXGridView offered since it gives you full control over how the data retrieval is done in the ViewModel.</p>
<h2>4 Built-in Exporting Data Format</h2>
<p>UXGridView allows you to export the data source into four data format – not only one, or two. Users have the choice to export data to HTML, Excel, CSV or just a plain text file. From the user interface perspective, all you need to do is to set the <strong>CanUserExport</strong> property to true. A tiny, stylish dropdown button will then appear in the status bar, next to the data pager. The available data format is listed in the menu when the dropdown button is clicked, such as shown below.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/image11.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Exporting user interface" src="http://intersoftpt.files.wordpress.com/2011/03/image_thumb11.png" border="0" alt="Exporting user interface" width="588" height="482" /></a></p>
<p>Although the user interface has been well predefined, they are fully customized thanks to the loosely-coupled UI architecture. For instances, you can change the dropdown button to a more stylish callout, or just a plain command button if you preferred.</p>
<p>When the data exporting process completes, you’ll be prompted to save the results to your local computer. The following illustration shows the Excel spreadsheet that contains the exported results.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/image12.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="UXGridView data exported to Excel" src="http://intersoftpt.files.wordpress.com/2011/03/image_thumb12.png" border="0" alt="UXGridView data exported to Excel" width="642" height="401" /></a></p>
<p>UXGridView also offers a number of exporting options such as whether to include column footers, column headers or the group footers in the exported results. For even more fine-grained HTML results, you can customize the style of each generated row and cell output through the <strong>ExportCssStyleSelector</strong>, another big plus for MVVM implementation!</p>
<h2>Style and Template Selectors</h2>
<p>UXGridView implements a wealth of style selectors and template selectors, giving the freedom you need to create rich data presentation the way you want. The selector pattern is a first-class MVVM citizen that enables you to write custom logics in a separate class instead of in the view level. You get two benefits immediately: greater reusability and cleaner implementation due to the view/code separation.</p>
<p>One of the most common scenarios, for instances, is to show discontinued products in a different background color, allowing users to quickly distinguish the useful information they need to work with. The following illustration shows the results of a <strong>RowStyleSelector</strong> implementation.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/image13.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="RowStyleSelector in UXGridView" src="http://intersoftpt.files.wordpress.com/2011/03/image_thumb13.png" border="0" alt="RowStyleSelector in UXGridView" width="642" height="213" /></a></p>
<p>Another common scenario is to display different information based on specific conditions. For instances, showing a Reorder hyperlink button in the case that the products were out-of-stock. This can be done through an implementation of <strong>CellTemplateSelector</strong>, see the results below.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/image14.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="CellTemplateSelector in UXGridView" src="http://intersoftpt.files.wordpress.com/2011/03/image_thumb14.png" border="0" alt="CellTemplateSelector in UXGridView" width="642" height="213" /></a></p>
<p>Or how about a more advanced scenario like applying a different background brush in the row header of each different group level? That’s also possible to be done through an implementation of <strong>RowGroupHeaderStyleSelector</strong>.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/image15.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="RowGroupHeaderStyleSelector in UXGridView" src="http://intersoftpt.files.wordpress.com/2011/03/image_thumb15.png" border="0" alt="RowGroupHeaderStyleSelector in UXGridView" width="519" height="482" /></a></p>
<p>I hope the above illustrations give you a clear idea what the style and template selectors are all about.</p>
<p>To be more exact, UXGridView provides 13 selectors for the row, cell, column header, column footer and group elements. The complete list is as follows:</p>
<ul>
<li>Row Style Selector</li>
<li>Row Template Selector</li>
<li>Cell Style Selector</li>
<li>Cell Template Selector</li>
<li>Column Header Style Selector</li>
<li>Column Header Template Selector</li>
<li>Column Footer Style</li>
<li>Column Footer Cell Style</li>
<li>Column Footer Cell Template</li>
<li>Row Details Template Selector</li>
<li>Row Group Header Style Selector</li>
<li>Row Group Footer Style</li>
<li>Row Group Footer Cell Style</li>
</ul>
<p>Note that the above selectors have not included the selectors of other elements such as editing and exporting.</p>
<h2>Multi Aggregates</h2>
<p>Another nice addition in the RC release is the support for multiple aggregates in both the column footer and group footer. It will be definitely useful for line-of-business applications, particularly in financial extensive applications. So here the feature is when you need it.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/image16.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Multi aggregates support in UXGridView" src="http://intersoftpt.files.wordpress.com/2011/03/image_thumb16.png" border="0" alt="Multi aggregates support in UXGridView" width="642" height="328" /></a></p>
<h2>Custom Grouping</h2>
<p>The RC release adds more powerful features allowing developers to fine-tuning the grouping results in UXGridView. While most competing grids used locked-down approaches, UXGridView is quite the opposite. You can now define your own custom groups by writing custom logics in a separate class which is then instantiated in the XAML and assigned to the <strong>GroupConverter</strong> property of the <strong>UXGridViewGroupDescriptor</strong>.</p>
<p>The sample in the following illustration groups the products data based on a range of CategoryID values.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/image17.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Grouping with custom logic" src="http://intersoftpt.files.wordpress.com/2011/03/image_thumb17.png" border="0" alt="Grouping with custom logic" width="642" height="322" /></a></p>
<p>Another popular scenario that can be achieved using the group converter is the value list capability where more meaningful information can be displayed in the group header instead of useless IDs, for instances, displaying the actual name of a category instead of the ID such as shown below.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/image18.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Grouping with value list" src="http://intersoftpt.files.wordpress.com/2011/03/image_thumb18.png" border="0" alt="Grouping with value list" width="642" height="268" /></a></p>
<h2>Read-only Binding</h2>
<p>Last but not least, among the top requested features is the read-only binding which we managed to ship in the RC release. With the read-only binding expression, you can write a custom logic that determines when a particular row or cell should be read-only (not editable).</p>
<p>UXGridView provides read-only binding at both the row and cell level. The read-only binding expression at row level, if returns true when evaluated, will supersede the read-only binding expression at the cell level. This means that if the read-only binding is specified at the row level and returns a true value, the entire row will no longer editable regardless of the value of the binding expression specified in the cells.</p>
<p>For  examples, consider a scenario where discontinued products should be not editable. In such case, the <strong>IsReadOnlyBinding </strong>of the UXGridView is bound to the <strong>Discontinued </strong>property of the product entity. To prevent users to accidentally uncheck the Discontinued value, the same property can be bind to the <strong>IsReadOnlyBinding</strong> of the <strong>UXGridViewColumn</strong>. The binding expression at the UXGridView level applies to the rows, while the one at the UXGridViewColumn applies to the cells.</p>
<p>Luckily, the RC release shipped with an example based on the above scenarios. The following illustration shows the discontinued product which can no longer be edited.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/image19.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="IsReadOnlyBinding in UXGridView" src="http://intersoftpt.files.wordpress.com/2011/03/image_thumb19.png" border="0" alt="IsReadOnlyBinding in UXGridView" width="642" height="402" /></a></p>
<h2>WCF RIA SP1 Support</h2>
<p>The UXGridView, UXDataPager and UXDataFilter controls in the RC release have been updated to support the recently released WCF RIA SP1. Most notable is the paging support for new data model returned in the children of the navigator properties. The data controls are also backward compatible with the previous WCF RIA.</p>
<h2>Download the RC Bits</h2>
<p>UXGridView Release Candidate includes complete feature sets and near-RTM quality, which means that you can start using UXGridView to build amazingly rich data-centric applications for the Silverlight and WPF platforms. As you have learned through the series of <a href="http://intersoftpt.wordpress.com/tag/uxgridview/">technology preview releases</a>, each UXGridView feature is uniquely engineered to work best for many MVVM scenarios, making it the industry’s first and most advanced MVVM-ready data grid for the Silverlight and WPF development.</p>
<p>To summarize, the RC release adds a host of exciting new and essential features such as data exporting, style and template selectors, multi aggregates, and much more. We’ve also added many new samples that demonstrate real-world development scenarios such as using different sort member for value list and displaying an image in the cells. The RTM version will add a couple “extra” features, so stay tuned for the next announcement!</p>
<p>Click <a href="http://www.intersoftpt.com/ClientUI/Intersoft.ClientUI.Data.RC.zip">here</a> to download the RC bits and test-drive the new UXGridView features today. The download package includes latest ClientUI assemblies as well as updated and new samples for both Silverlight and WPF platforms.</p>
<p>Please note that the UXGridView RC is the last public community release. The next milestone would be the UXGridView RTM release together with dozens of new members in ClientUI 5. For now, we’d love to hear what you think about the new features and enhancements available in the RC. Please post your feedback, questions or issues to our <a href="http://www.intersoftpt.com/Community/ClientUI">community forum</a>.</p>
<p>Best,<br />
Jimmy<br />
Chief Software Architect</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2011/03/uxgridview-rc-adds-mvvm-data-exporting-multi-aggregates-selectors-and-more/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>UXGridView CTP3: Feature-complete Grid for Silverlight &amp; WPF</title>
		<link>http://blog.intersoftsolutions.com/2011/03/uxgridview-ctp3-feature-complete-grid-for-silverlight-wpf/</link>
		<comments>http://blog.intersoftsolutions.com/2011/03/uxgridview-ctp3-feature-complete-grid-for-silverlight-wpf/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 18:03:35 +0000</pubDate>
		<dc:creator><![CDATA[Jimmy Petrus]]></dc:creator>
				<category><![CDATA[2011 R1]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[ClientUI]]></category>
		<category><![CDATA[CTP]]></category>
		<category><![CDATA[QueryDescriptor]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[UX]]></category>
		<category><![CDATA[UXGridView]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">https://intersoftpt.wordpress.com/2011/03/03/uxgridview-ctp3-feature-complete-grid-for-silverlight-wpf/</guid>
		<description><![CDATA[I hope you’ve enjoyed the second CTP of our upcoming data controls released a couple weeks ago, which includes MVVM-ready data validation and data editing capabilities, as well as customizable editing control architecture. Make sure you also check out Andry’s blog posts covering the editing [...]]]></description>
				<content:encoded><![CDATA[<img width="558" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2014/09/image_thumb29-604x292.png" class="attachment-post-thumbnail wp-post-image" alt="Row details with expand button" style="float:right; margin:0 0 10px 10px;" /><p>I hope you’ve enjoyed the <a href="http://intersoftpt.wordpress.com/2011/02/21/uxgridview-ctp2-mvvm-data-editing/" target="_blank">second CTP</a> of our upcoming data controls released a couple weeks ago, which includes MVVM-ready data validation and data editing capabilities, as well as customizable editing control architecture. Make sure you also check out Andry’s blog posts covering the editing features in-depth <a href="http://intersoftpt.wordpress.com/2011/02/25/uxgridview-part-4-data-editing-the-mvvm-way-with-commands/" target="_blank">here</a> and <a href="http://intersoftpt.wordpress.com/2011/03/01/uxgridview-part-5-using-custom-editing-controls/" target="_blank">here</a>. </p>
<p>Today, I’m excited to announce the third CTP release of our forthcoming UXGridView control. The release includes the expected feature sets according to the CTP milestone described in my earlier post <a href="http://intersoftpt.wordpress.com/2011/02/07/introducing-uxgridview-the-mvvm-ready-grid-for-silverlight-and-wpf/" target="_blank">here</a>, plus a handful of nice additions such as enhanced row details, new expander column, and a sophisticated Gmail-style column checker.</p>
<p>Some of the key highlights in this new CTP are discussed in the following.</p>
<h2>QueryDescriptor Enhancement</h2>
<p>The QueryDescriptor now includes RaiseQueryChanged() method, thanks to <a href="http://www.linkedin.com/groupItem?view=&amp;gid=124074&amp;type=member&amp;item=43411780&amp;commentID=32173627&amp;qid=a9e3f27f-2329-48ca-b6b4-faf03595aac4&amp;goback=.gmp_124074#commentID_32173627" target="_blank">Werner Grift</a> for the nice feedback in the LinkedIn group discussion. With the new method, you can programmatically raise the QueryChanged event in your ViewModel, such as when a related view has changed, or when the view needs to be refreshed due to user interaction like button click (called through the delegate command).</p>
<h2>Improved Row Details and Hierarchical Grid</h2>
<p>The row details feature receives major update in this new CTP release, which now works with the new expander column. The expander column contains a toggle button which is convenient for users to expand or collapse the row details at runtime, see the illustration below.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/image.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Row details with expand button" border="0" alt="Row details with expand button" src="http://intersoftpt.files.wordpress.com/2011/03/image_thumb.png" width="642" height="292" /></a></p>
<p>With the new expander column, it’s now possible to use the row details for more advanced business scenarios, for instances, implementing a hierarchical/nested grid such as in Customer-Orders scenario. </p>
<p>Another interesting scenario is the support to load the child data “on demand” based on the expanded item. UXGridView now includes a new property called ExpandedItem, making it possible for you to bind the child data on demand in the ViewModel. Both WCF RIA and DevForce samples are provided to demonstrate how to achieve such scenario.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/image1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Nested UXGridView" border="0" alt="Nested UXGridView" src="http://intersoftpt.files.wordpress.com/2011/03/image_thumb1.png" width="621" height="482" /></a></p>
<p>Notice that the paging and other settings can be applied individually in the child grid for best performance and results.</p>
<h2>New Select Column</h2>
<p>When I got the CTP build fresh from the lab, this particular new feature looks to be the most impressive. It’s one of my favorite features, and certainly deserves to be one of yours. Take a look at the screenshot below.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/image2.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Select column with row checker" border="0" alt="Select column with row checker" src="http://intersoftpt.files.wordpress.com/2011/03/image_thumb2.png" width="622" height="544" /></a></p>
<p>Although seems common, the select column feature is not available in any other Silverlight/WPF grids in the market – not the one with correct implementation.</p>
<p>The interesting point about this feature is its automatic checked items persistence capability. This means that if you check all the rows in page 1, then go to page 2, the previously checked items will remain persisted. This behavior also applies consistently in all the grid operations such as sorting and grouping. In the above example, we verified the persistence concept by binding the CheckedItems property to a list box which shows all the checked items regardless of the paged view scope.</p>
<p>With the feature correctly implemented along with the MVVM support, it will be useful in many scenarios in business applications – think of web-based mail applications such as Gmail or Hotmail for examples.</p>
<h2>Deferred Scrolling Mode</h2>
<p>Another nice feature that we managed to include in this CTP release is the deferred scrolling mode. When enabled, dragging the thumb of the vertical scrollbar will not update the view immediately. Instead, an intuitive visual hint will appear near the scrollbar indicating the target row of the scroll position. See the screenshot below for details.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/image3.png"><img style="padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Deferred scrolling with customizable visual hint" border="0" alt="Deferred scrolling with customizable visual hint" src="http://intersoftpt.files.wordpress.com/2011/03/image_thumb3.png" width="642" height="405" /></a></p>
<p>This scrolling mode is particularly useful when you have relatively large amount of rows, and also allowing users to quickly scan the information as they scroll through the viewport.</p>
<h2>Standards-Compliant User Experiences</h2>
<p>As in our good tradition of development, all Intersoft’s UI controls are designed with the best user experiences that conform to the ISO Standards 9241, including the focus and unfocused behavior, keyboard&#160; navigation using arrow keys, and many more.</p>
<p>In this new CTP release, the UXGridView now shows a dimmed focus visual style when the control doesn’t have focus. This enables users to intuitively responding to the user interface based on the visual state presented in the application. The following illustration shows the unfocused visual state of the UXGridView.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/image4.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="ISO-standards UX" border="0" alt="ISO-standards UX" src="http://intersoftpt.files.wordpress.com/2011/03/image_thumb4.png" width="632" height="575" /></a></p>
<h2>Download the CTP3 Bits</h2>
<p>In summary, the CTP3 release includes nearly-complete feature sets of UXGridView planned for final release later this month. So far, the latest CTP includes full MVVM support for server data access, server paging and filtering, data validation, editing, customizable edit controls, row details, multiple selection, checker column, deferred scroll mode, flexible appearance and layout settings, and much more. The final release will include more advanced features such as data exporting, data virtualization, and an advanced column filter interface.</p>
<p>Click <a href="http://www.intersoftpt.com/ClientUI/Intersoft.ClientUI.Data.CTP3.zip">here</a> to download the CTP3 bits and test-drive the new UXGridView features today. The download package includes latest ClientUI assemblies as well as updated and new samples for both Silverlight and WPF platforms.</p>
<p>Enjoy the new CTP bits! We’d love to hear what you think about the new features available in CTP3, please post your feedback, questions or issues to our <a href="http://www.intersoftpt.com/Community/ClientUI">community forum</a>.</p>
<p>All the best,    <br />Jimmy</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2011/03/uxgridview-ctp3-feature-complete-grid-for-silverlight-wpf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UXGridView Part 5: Using Custom Editing Controls</title>
		<link>http://blog.intersoftsolutions.com/2011/03/uxgridview-part-5-using-custom-editing-controls/</link>
		<comments>http://blog.intersoftsolutions.com/2011/03/uxgridview-part-5-using-custom-editing-controls/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 12:35:08 +0000</pubDate>
		<dc:creator><![CDATA[ansoesil]]></dc:creator>
				<category><![CDATA[2011 R1]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[ClientUI]]></category>
		<category><![CDATA[Editing]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[UXGridView]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://intersoftpt.wordpress.com/?p=2164</guid>
		<description><![CDATA[In the previous post, I’ve covered the basics of data validation and editing using UXGridView the MVVM-way. In this post, I will show you how to extend UXGridView’s editing experiences by customizing the available column types, the editing template and the editing template selector. Defining [...]]]></description>
				<content:encoded><![CDATA[<p>In the previous <a href="http://intersoftpt.wordpress.com/2011/02/25/uxgridview-part-4-data-editing-the-mvvm-way-with-commands/">post</a>, I’ve covered the basics of data validation and editing using UXGridView the MVVM-way. In this post, I will show you how to extend UXGridView’s editing experiences by customizing the available column types, the editing template and the editing template selector.</p>
<h2>Defining Columns Manually </h2>
<p>First of all, you need to set the <strong>AutoGenerateColumns</strong> property of the UXGridView control to <strong>false</strong>.</p>
<p>  </p><pre class="crayon-plain-tag">&lt;Intersoft:UXGridView AutoGenerateColumns=&quot;False&quot;&gt;                
&lt;/Intersoft:UXGridView&gt;</pre><p></p>
<p>Next, you specify each column manually as follows.</p>
<p></p><pre class="crayon-plain-tag">&lt;Intersoft:UXGridView AutoGenerateColumns=&quot;True&quot;&gt;
    &lt;Intersoft:UXGridView.Columns&gt;
        &lt;Intersoft:UXGridViewCheckBoxColumn
            Header=&quot;Discontinued&quot;
            Binding=&quot;{Binding Discontinued}&quot;/&gt;
        &lt;Intersoft:UXGridViewComboBoxColumn 
            Header=&quot;Category ID&quot; Width=&quot;120&quot;
            DisplayMemberPath=&quot;CategoryName&quot; ValueMemberPath=&quot;CategoryID&quot; 
            Binding=&quot;{Binding CategoryID}&quot;                                                         
            ValueListSource=&quot;{Binding Categories,
            Source={StaticResource CategoriesViewModel}}&quot;/&gt;
        &lt;Intersoft:UXGridViewTextColumn 
            Header=&quot;Product ID&quot; 
            Binding=&quot;{Binding ProductID}&quot; 
            IsReadOnly=&quot;True&quot;/&gt;
        &lt;Intersoft:UXGridViewTextColumn 
            Header=&quot;Product Name&quot;
            Binding=&quot;{Binding ProductName}&quot;/&gt;
        &lt;Intersoft:UXGridViewTextColumn 
            Header=&quot;Units In Stock&quot; 
            Binding=&quot;{Binding UnitsInStock}&quot;/&gt;
        &lt;Intersoft:UXGridViewTextColumn 
            Header=&quot;Unit Price&quot; 
            Binding=&quot;{Binding UnitPrice}&quot;/&gt;
        &lt;Intersoft:UXGridViewTextColumn 
            Header=&quot;Units On Order&quot; 
            Binding=&quot;{Binding UnitsOnOrder}&quot;/&gt;
        &lt;Intersoft:UXGridViewTextColumn 
            Header=&quot;Quantity Per Unit&quot;
            Binding=&quot;{Binding QuantityPerUnit}&quot;/&gt;
    &lt;/Intersoft:UXGridView.Columns&gt;                               
&lt;/Intersoft:UXGridView&gt;</pre><p></p>
<p>The results look like the following screenshot.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/gridedittemplate1.png"><img class="alignnone size-full wp-image-2165" title="Dropdown column in UXGridView" alt="Dropdown column in UXGridView" src="http://intersoftpt.files.wordpress.com/2011/03/gridedittemplate1.png" width="640" height="453" /></a></p>
<p>Notice that I used three different types of column.</p>
<ul>
<li><strong>UXGridViewTextColumn</strong>
<p>The column has a textual representation for data display and a <strong>UXTextBox</strong> for data editing control.</p>
</li>
<li><strong>UXGridViewCheckBoxColumn</strong>
<p>The column has a check box representation to display the data and a <strong>UXCheckBox</strong> for data editing control.</p>
</li>
<li><strong>UXGridViewComboBoxColumn</strong>
<p>The column has a textual representation to display the data, a dropdown button to display the data list, and a <strong>UXComboBox</strong> for data editing control. </li>
</ul>
<p>Using UXGridViewTextColumn<strong> </strong>and UXGridViewCheckBoxColumn is pretty straightforward, you just need to set the <strong>Binding</strong> and <strong>Header</strong> properties, and you’re all set. For UXGridViewComboBoxColumn, you need to specify the <strong>ValueListSource</strong> which is required for the combo box data source, along with the <strong>DisplayMemberPath</strong> and <strong>ValueMemberPath</strong>. </p>
<p>In this sample, I assigned the ValueListSource&#160; for the UXGridViewComboBoxColumn from a static resource.</p>
<p></p><pre class="crayon-plain-tag">&lt;Grid.Resources&gt;
    &lt;ViewModels:CategoriesViewModel x:Key=&quot;CategoriesViewModel&quot;/&gt;        
&lt;/Grid.Resources&gt;</pre><p></p>
<p>The Categories ViewModel looks like the following code.</p>
<p></p><pre class="crayon-plain-tag">using System.Collections.Specialized;
using Intersoft.Client.Data.ComponentModel;
using UXGridView.Samples.ModelServices;

namespace UXGridView.Samples.ViewModels
{
    public class CategoriesViewModel : ViewModelBase
    {
        public CategoriesViewModel()
        {
            this.CategoriesSource = CategoriesRepository.Instance;
            this.LoadCategories();
        }

        private INotifyCollectionChanged _Categories;

        public INotifyCollectionChanged Categories
        {
            get { return this._Categories; }
            set
            {
                if (this._Categories != value)
                {
                    this._Categories = value;
                    this.OnPropertyChanged(&quot;Categories&quot;);
                }
            }
        }

        public IDataRepository CategoriesSource { get; set; }

        public virtual void LoadCategories()
        {
            this.CategoriesSource.GetData
            (
                (Categories) =&gt;
                {
                    this.Categories = new PagedCollectionView(Categories);
                },
                (error) =&gt;
                {

                }
            );
        }
    }
}</pre><p></p>
<p>Notice that the CategoriesViewModel simply retrieves the data from the CategoriesSource which used repository pattern for loosely-coupled data access. To learn more about data repository pattern, see the ProductsRepository example in my <a href="http://intersoftpt.wordpress.com/2011/02/25/uxgridview-part-4-data-editing-the-mvvm-way-with-commands/" target="_blank">previous blog post</a>.</p>
<h2>Using Custom Editing Controls</h2>
<p>In many business scenarios, you’re often asked to provide more advanced editing controls in the GridView rather than just a plain textbox, such as <strong>DateTimePicker</strong>, <strong>Slider</strong>, <strong>MaskedInput</strong>, etc. Luckily, it’s fairly easy to implement in UXGridView, thanks to the solid editing architecture. All you need to do is simply creating a data template that contains the input control of your choice, and assign it to the <strong>CellEditingTemplate</strong> property of the UXGridView.</p>
<p>The following examples show how to customize the editing control of each column through the provided <strong>CellEditingTemplate</strong> property.</p>
<p></p><pre class="crayon-plain-tag">&lt;Intersoft:UXGridViewTextColumn 
    Header=&quot;Units In Stock&quot; 
    Binding=&quot;{Binding UnitsInStock}&quot;&gt;
    &lt;Intersoft:UXGridViewTextColumn.CellEditingTemplate&gt;
        &lt;DataTemplate&gt;
            &lt;<strong>Intersoft:UXNumericUpDown</strong> 
                Maximum=&quot;9999&quot; 
                Value=&quot;{Binding UnitsInStock, Mode=TwoWay}&quot; 
                HorizontalAlignment=&quot;Stretch&quot; 
                VerticalAlignment=&quot;Stretch&quot;/&gt;
        &lt;/DataTemplate&gt;
    &lt;/Intersoft:UXGridViewTextColumn.CellEditingTemplate&gt;
&lt;/Intersoft:UXGridViewTextColumn&gt;<br />
<br />&lt;Intersoft:UXGridViewTextColumn 
    Header=&quot;Unit Price&quot; 
    Binding=&quot;{Binding UnitPrice}&quot;&gt;
    &lt;Intersoft:UXGridViewTextColumn.CellEditingTemplate&gt;
        &lt;DataTemplate&gt;
            &lt;<strong>Intersoft:UXCurrencyEditor</strong> 
                EditMask=&quot;c2&quot; 
                UseEditMaskAsDisplayMask=&quot;True&quot; 
                Value=&quot;{Binding UnitPrice, Mode=TwoWay}&quot;/&gt;
        &lt;/DataTemplate&gt;
    &lt;/Intersoft:UXGridViewTextColumn.CellEditingTemplate&gt;
&lt;/Intersoft:UXGridViewTextColumn&gt;<br />
&lt;Intersoft:UXGridViewTextColumn 
    Header=&quot;Units On Order&quot; 
    Binding=&quot;{Binding UnitsOnOrder}&quot;&gt;
    &lt;Intersoft:UXGridViewTextColumn.CellEditingTemplate&gt;
        &lt;DataTemplate&gt;
            &lt;<strong>Intersoft:UXSliderBar</strong> 
                Value=&quot;{Binding UnitsOnOrder, Mode=TwoWay}&quot; 
                SmallChange=&quot;10&quot; 
                LargeChange=&quot;20&quot;
                Maximum=&quot;100&quot;/&gt;
        &lt;/DataTemplate&gt;
    &lt;/Intersoft:UXGridViewTextColumn.CellEditingTemplate&gt;
&lt;/Intersoft:UXGridViewTextColumn&gt;</pre><p></p>
<p>The following examples show how to use UXDateTimePicker to edit a date time column. Notice that you can bind the BirthDate to the column and directly specify the string format in the binding expression.</p>
<p></p><pre class="crayon-plain-tag">&lt;Intersoft:UXGridViewTextColumn 
    Header=&quot;Birth Date&quot; 
    Binding=&quot;{Binding BirthDate, StringFormat=MM/dd/yyyy}&quot;&gt;
    &lt;Intersoft:UXGridViewTextColumn.CellEditingTemplate&gt;
        &lt;DataTemplate&gt;
            &lt;Grid Background=&quot;White&quot; Margin=&quot;1&quot;&gt;
                &lt;Intersoft:UXDateTimePicker 
                    Value=&quot;{Binding BirthDate, Mode=TwoWay}&quot; 
                    EditMask=&quot;MM/dd/yyyy&quot; 
                    BorderThickness=&quot;0&quot;                                                              
                    UseEditMaskAsDisplayMask=&quot;True&quot; 
                    VerticalAlignment=&quot;Center&quot; 
                    HorizontalAlignment=&quot;Stretch&quot;/&gt;
            &lt;/Grid&gt;
        &lt;/DataTemplate&gt;
    &lt;/Intersoft:UXGridViewTextColumn.CellEditingTemplate&gt;
&lt;/Intersoft:UXGridViewTextColumn&gt;<br />
&lt;Intersoft:UXGridViewTemplateColumn 
    Header=&quot;Address&quot; 
    Binding=&quot;{Binding Address}&quot; 
    Width=&quot;100&quot;&gt;
    &lt;Intersoft:UXGridViewTemplateColumn.CellTemplate&gt;
        &lt;DataTemplate&gt;
            &lt;TextBlock 
                TextWrapping=&quot;Wrap&quot; 
                Text=&quot;{Binding Address}&quot; 
                Margin=&quot;4&quot;/&gt;
        &lt;/DataTemplate&gt;
    &lt;/Intersoft:UXGridViewTemplateColumn.CellTemplate&gt;
    &lt;Intersoft:UXGridViewTemplateColumn.CellEditingTemplate&gt;
        &lt;DataTemplate&gt;
            &lt;Intersoft:UXTextBox 
                AcceptsReturn=&quot;True&quot; 
                TextWrapping=&quot;Wrap&quot; 
                Text=&quot;{Binding Address, Mode=TwoWay}&quot;/&gt;
        &lt;/DataTemplate&gt;
    &lt;/Intersoft:UXGridViewTemplateColumn.CellEditingTemplate&gt;
&lt;/Intersoft:UXGridViewTemplateColumn&gt;</pre><p></p>
<p>As seen in the example above, UXGridView provides a template column named <strong>UXGridViewTemplateColumn.</strong> This column allows you to change both display and editing appearance. In the example, the UXGridViewTemplateColumn uses a wrapable TextBlock for the display, and a multi-line TextBox for data editing.</p>
<p>You can define literally any kind of input controls that support MVVM in the CellEditingTemplate, including our latest advanced input controls such as UXCalendar, UXDomainUpDown, UXDateTimeEditor, and so forth.</p>
<h2>Using Cell Editing Template Selector</h2>
<p>A rather unique scenario is where the users would like to have different editing control for the same column which depends on the data being edited. This can be achieved elegantly in UXGridView by using <strong>CellEditingTemplateSelector</strong>. It works similar to any other template selectors, so the first thing you need to do is creating a template selector class that derived from <strong>DataTemplateSelector</strong>.</p>
<p></p><pre class="crayon-plain-tag">using System.Windows;
using Intersoft.Client.Framework;
using Intersoft.Client.UI.Data;

namespace UXGridView.Samples.Selectors
{
    public class CellEditingSelector: DataTemplateSelector
    {
        public DataTemplate NumericEditor { get; set; }
        public DataTemplate SliderEditor { get; set; }

        public override DataTemplate SelectTemplate(object item, 
                 DependencyObject container)
        {            
            UXGridViewCell cell = container as UXGridViewCell;
            UXGridViewRowBase rowBase = cell.OwningRowBase;
            UXGridViewRow row = rowBase as UXGridViewRow;

            switch (cell.OwningColumn.PropertyName)
            {
                case &quot;UnitsInStock&quot;:
                    if (rowBase.IsNewRow || (row != null &amp;&amp; row.Index % 2 != 0))
                        return this.SliderEditor;
                    else
                        return this.NumericEditor;                    
            }

            return null;
        }
    }
}</pre><p></p>
<p>The above code basically selects the editing control differently depending on whether the row is a normal or an alternating row. Notice that the conditioning is scoped to UnitsInStock column only.</p>
<p>Finally, let’s assign the template selector to the UXGridView, see the code below.</p>
<p></p><pre class="crayon-plain-tag">&lt;Grid.Resources&gt;
    &lt;DataTemplate x:Key=&quot;NumericEditor&quot;&gt;
        &lt;Intersoft:UXNumericUpDown Maximum=&quot;100&quot;
                   Value=&quot;{Binding UnitsInStock, Mode=TwoWay}&quot;
                   HorizontalAlignment=&quot;Stretch&quot;
                   VerticalAlignment=&quot;Stretch&quot;/&gt;
    &lt;/DataTemplate&gt;
    &lt;DataTemplate x:Key=&quot;SliderEditor&quot;&gt;
        &lt;Intersoft:UXSliderBar
                   Value=&quot;{Binding UnitsInStock, Mode=TwoWay}&quot;
                   SmallChange=&quot;10&quot; LargeChange=&quot;20&quot; Maximum=&quot;100&quot;/&gt;
    &lt;/DataTemplate&gt;<br />            
<strong>    &lt;Selectors:CellEditingSelector x:Key=&quot;CellEditingSelector&quot;
               NumericEditor=&quot;{StaticResource NumericEditor}&quot;
               SliderEditor=&quot;{StaticResource SliderEditor}&quot;/&gt;</strong>
&lt;/Grid.Resources&gt;

&lt;Intersoft:UXGridView <strong>CellEditingTemplateSelector=
                     &quot;{StaticResource CellEditingSelector}&quot;</strong>&gt;</pre><p></p>
<p>As the result, editing the cells of UnitsInStock for the normal row will show a UXNumericUpDown control. See the illustration below.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/gridedittemplate2.png"><img class="alignnone size-full wp-image-2166" title="UXNumericUpDown for normal row editing" alt="UXNumericUpDown for normal row editing" style="border:black 1px solid;" src="http://intersoftpt.files.wordpress.com/2011/03/gridedittemplate2.png" width="640" height="60" /></a></p>
<p>While editing the cells for the alternating row of the same column will show a UXSliderBar control instead.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/03/gridedittemplate3.png"><img class="alignnone size-full wp-image-2167" title="UXSliderBar for alternate row editing" alt="UXSliderBar for alternate row editing" border="1" style="border:black 1px solid;" src="http://intersoftpt.files.wordpress.com/2011/03/gridedittemplate3.png" width="640" height="60" /></a></p>
<p>That’s all for now, I hope this post gives you some cool ideas on using the available column types and customizing the editing controls in UXGridView. All samples I used in this blog post are available in our latest CTP release. Click <a href="http://www.intersoftpt.com/ClientUI/Intersoft.ClientUI.Data.CTP2.zip">here</a> to download it now and get yourself familiar with the MVVM implementation in the UXGridView, starting from the data retrieval, handling the data editing, to customizing editing controls.</p>
<p>Best Regards,<br />
  <br />Andry</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2011/03/uxgridview-part-5-using-custom-editing-controls/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>UXGridView Part 4: Data Editing the MVVM-way with Commands</title>
		<link>http://blog.intersoftsolutions.com/2011/02/uxgridview-part-4-data-editing-the-mvvm-way-with-commands/</link>
		<comments>http://blog.intersoftsolutions.com/2011/02/uxgridview-part-4-data-editing-the-mvvm-way-with-commands/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 15:33:23 +0000</pubDate>
		<dc:creator><![CDATA[ansoesil]]></dc:creator>
				<category><![CDATA[2011 R1]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[ClientUI]]></category>
		<category><![CDATA[Command Framework]]></category>
		<category><![CDATA[DevForce]]></category>
		<category><![CDATA[Editing]]></category>
		<category><![CDATA[MVVM]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[UXGridView]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://intersoftpt.wordpress.com/?p=2147</guid>
		<description><![CDATA[In the previous post, Jimmy announced the latest CTP for UXGridView with the CUD (Create, Update and Delete) capability. In this post, I will provide the step-by-step instructions to work with these new features. Enabling the CUD capability First of all, let’s enable the CUD [...]]]></description>
				<content:encoded><![CDATA[<p>In the previous <a href="http://intersoftpt.wordpress.com/2011/02/21/uxgridview-ctp2-mvvm-data-editing/">post</a>, Jimmy announced the latest CTP for UXGridView with the CUD (Create, Update and Delete) capability. In this post, I will provide the step-by-step instructions to work with these new features.</p>
<h2>Enabling the CUD capability </h2>
<p>First of all, let’s enable the CUD (Create, Update, Delete) capability in UXGridView. You can enable these features by simply setting the <strong>CanUserAdd</strong>, <strong>CanUserEdit</strong>, and <strong>CanUserDelete</strong> properties to <strong>True</strong>.</p>
<p>  </p><pre class="crayon-plain-tag">&lt;Intersoft:UXGridView CanUserAdd=&quot;True&quot; 
                      CanUserDelete=&quot;True&quot; 
                      CanUserEdit=&quot;True&quot;/&gt;</pre><p></p>
<p>Notice that there will be a NewRow element at the top of the Grid when you set the <strong>CanUserAdd</strong> property to <strong>True</strong>.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/02/gridedit1.png"><img class="alignnone size-full wp-image-2148" title="gridedit1" alt="" src="http://intersoftpt.files.wordpress.com/2011/02/gridedit1.png?w=640&amp;h=179" width="640" height="179" /></a></p>
<p>Furthermore, you can also delete or edit the selected item(s) when the <strong>CanUserEdit</strong> or <strong>CanUserDelete</strong> properties are set to <strong>True</strong>.</p>
<p>To edit a row you can use either mouse or keyboard. The following list shows you some configuration that you can change to edit a record using mouse / keyboard.</p>
<p>To edit a row using mouse:</p>
<ul>
<li>EditMouseGesture
<ul>
<li>Single Click
<p>Directly begin edit to the current selected cell.</p>
</li>
<li>Second Click
<p>Begin edit to the current selected cell after the row is selected.</p>
</li>
<li>Double Click
<p>Directly begin edit to the current selected cell when double click fires.</p>
</li>
</ul>
</li>
</ul>
<p>To edit a row using keyboard:</p>
<ul>
<li>EditKeyGEditKeyGesture
<ul>
<li>F2
<p>Directly begin edit to the current selected cell using F2 key.</p>
</li>
<li>Any Keystroke
<p>Directly begin edit to the current selected cell from any key stroke.</p>
</li>
</ul>
</li>
<li>EnterKeyAction
<ul>
<li>EnterEdit
<p>Directly begin edit to the current selected cell using Enter key.</p>
</li>
<li>MoveToNextRow
<p>Move to next row (does not edit the cell).</p>
</li>
</ul>
</li>
<li>EditEnterKeyAction
<ul>
<li>CommitAndMovetoNextRow
<p>Commit the changes at current edited row and move to the next row.</p>
</li>
<li>ExitEdit
<p>Exit the cell edit of the current edited cell.</p>
</li>
<li>MoveToNextEditableCell
<p>Move to next editable cell. (Will move to next row&#8217;s cell when it reach the end of the row)</p>
</li>
</ul>
</li>
</ul>
<p>Beside these options, you can also use several common keystroke as listed below during editing.</p>
<ul>
<li>Tab / Shift + Tab
<p>To move to next / previous editable cell.</p>
</li>
<li>Shift + Enter
<p>Commit the changes at current edited row and stay in the current selection</p>
</li>
<li>Delete
<p>Delete the current selected record(s)</p>
</li>
<li>Escape
<p>Cancel current changes. If currently you are in an active edit cell, it will cancel the cell changes. If you are in current active edit row, it will cancel the row changes.</p>
</li>
</ul>
<h2>Handling the CUD operation</h2>
<p>To handle the CUD operation, UXGridView provides several command-related properties that you can specify to execute a method depending on the actions. These command- properties are listed as follows:</p>
<ul>
<li>PrepareNewRowCommand
<p>Called when you begin edit at the NewRow element. Used to initialized the NewRowItem.</p>
</li>
<li>ValidateRowCommand
<p>Validate the row before the row is committed.</p>
</li>
<li>InsertRowCommand
<p>Called when a new row is committed. You can directly save the changes and/or refresh the UXGridView if necessary.</p>
</li>
<li>UpdateCellCommand
<p>Called when the cell is committed.</p>
</li>
<li>UpdateRowCommand
<p>Called when an existing row is committed. You can directly save the changes and/or refresh the UXGridView if necessary.</p>
</li>
<li>DeleteRowCommand
<p>Called when a row is deleted. You can directly save the changes and / or refresh the UXGridView if necessary.</p>
</li>
<li>RejectRowCommand
<p>Called when the changes in the row is cancelled. This command is used to reject the changes in the data entity if required (such as in DevForce).</p>
</li>
<li>SaveChangesCommand
<p>Called when the save changes command is executed. You handle this command to save all the pending changes made in the UXGridView.</p>
</li>
<li>RejectChangesCommand
<p>Called when the reject changes command is executed. You handle this command to reject all the pending changes made in the UXGridView.</p>
</li>
</ul>
<p>These command properties can be bound to your ViewModel using delegate command. Next, I will show you how to bind these commands along with some important properties that are necessary for the CUD operation.</p>
<h3>Binding the CUD Commands to UXGridView using MVVM Pattern</h3>
<p>Let’s create the ViewModel for our example. First, define the delegate commands and the required selection properties, then instantiate them in the constructor.</p>
<p></p><pre class="crayon-plain-tag">using System.Collections;
using Intersoft.Client.Framework;
using Intersoft.Client.Framework.Input;
using Intersoft.Client.UI.Data;
using UXGridView.Samples.ModelServices;

namespace UXGridView.Samples.ViewModels
{
    public class ServerEditingViewModel : ServerSideOperationViewModel
    {        
        public ServerEditingViewModel()
            : base()
        {            
            this.DeleteRowCommand = 
                new DelegateCommand(ExecuteDeleteRow);
            this.InsertRowCommand = 
                new DelegateCommand(ExecuteInsertRow);
            this.PrepareNewRowCommand = 
                new DelegateCommand(ExecutePrepareNewRow);
            this.UpdateCellCommand = 
                new DelegateCommand(ExecuteUpdateCell);
            this.UpdateRowCommand = 
                new DelegateCommand(ExecuteUpdateRow);
            this.RejectRowCommand = 
                new DelegateCommand(ExecuteRejectRow);
            this.RejectChangesCommand = 
                new DelegateCommand(ExecuteRejectChanges);
            this.SaveChangesCommand = 
                new DelegateCommand(ExecuteSaveChanges);
            this.ValidateRowCommand = 
                new DelegateCommand(ExecuteValidateRow);
        }

        #region Fields

        private bool _hasChanges;
        private bool _isRefreshed;        
        private object _newProduct;
        private object _selectedProduct;
        private IEnumerable _selectedProducts;

        #endregion

        #region EditableProductsSource

        private IEditableDataRepository EditableProductsSource
        {
            get
            {
                return this.ProductsSource as IEditableDataRepository;
            }
        }

        #endregion

        #region Selection and Editing Properties

        public object NewProduct
        {
            get { return this._newProduct; }
            set
            {
                if (this._newProduct != value)
                {
                    this._newProduct = value;
                    this.OnPropertyChanged(&quot;NewProduct&quot;);
                }
            }
        }

        public object SelectedProduct
        {
            get { return this._selectedProduct; }
            set
            {
                if (this._selectedProduct != value)
                {
                    this._selectedProduct = value;
                    this.OnPropertyChanged(&quot;SelectedProduct&quot;);
                }
            }
        }

        public IEnumerable SelectedProducts
        {
            get { return this._selectedProducts; }
            set
            {
                if (this._selectedProducts != value)
                {
                    this._selectedProducts = value;
                    this.OnPropertyChanged(&quot;SelectedProducts&quot;);
                }
            }
        }

        public bool IsRefreshed
        {
            get { return this._isRefreshed; }
            set
            {
                if (this._isRefreshed != value)
                {
                    this._isRefreshed = value;
                    this.OnPropertyChanged(&quot;IsRefreshed&quot;);
                }
            }
        }

        public bool HasChanges
        {
            get { return _hasChanges; }
            set
            {
                if (_hasChanges != value)
                {
                    _hasChanges = value;
                    OnPropertyChanged(&quot;HasChanges&quot;);
                }
            }
        }

        #endregion

        #region Commands

        public DelegateCommand DeleteRowCommand { get; set; }
        public DelegateCommand InsertRowCommand { get; set; }
        public DelegateCommand PrepareNewRowCommand { get; set; }
        public DelegateCommand UpdateCellCommand { get; set; }
        public DelegateCommand UpdateRowCommand { get; set; }
        public DelegateCommand RejectRowCommand { get; set; }
        public DelegateCommand RejectChangesCommand { get; set; }
        public DelegateCommand SaveChangesCommand { get; set; }
        public DelegateCommand ValidateRowCommand { get; set; }

        #endregion
    }
}</pre><p></p>
<p>Next, we will bind these commands to the UXGridView.</p>
<p></p><pre class="crayon-plain-tag">&lt;Intersoft:UXPage 
	xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
	xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot; 
	xmlns:d=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;
	xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
	mc:Ignorable=&quot;d&quot;
	xmlns:Intersoft=&quot;http://intersoft.clientui.com/schemas&quot;
          xmlns:IntersoftModel=&quot;clr-namespace:Intersoft.Client.Data.Component<br />          Model.CollectionViews;assembly=Intersoft.Client.Data.ComponentModel&quot;
          xmlns:ViewModels=&quot;clr-namespace:UXGridView.Samples.ViewModels&quot;
	x:Class=&quot;UXGridView.Samples.Views.ServerSideOperation.Editing&quot; 
	Title=&quot;Editing Page&quot;
	d:DesignWidth=&quot;1024&quot; d:DesignHeight=&quot;800&quot;&gt;
	
	&lt;Grid x:Name=&quot;LayoutRoot&quot;&gt;
            &lt;Grid.DataContext&gt;
               &lt;ViewModels:ServerEditingViewModel/&gt;
            &lt;/Grid.DataContext&gt;<br />
        &lt;Intersoft:DockPanel&gt;

            &lt;Intersoft:UXGridView 
                AutoGenerateColumns=&quot;False&quot; QueryOperation=&quot;Server&quot;
                CanUserPage=&quot;True&quot; PageSize=&quot;20&quot;
                RowHeaderVisibility=&quot;Visible&quot;
                IsBusy=&quot;{Binding IsBusy, Mode=TwoWay}&quot;
                IsRefreshed=&quot;{Binding IsRefreshed, Mode=TwoWay}&quot;
                ItemsSource=&quot;{Binding Products}&quot; 
                SortDescriptors=&quot;{Binding QueryDescriptor.SortDescriptors, Mode=TwoWay}&quot;
                PageDescriptor=&quot;{Binding QueryDescriptor.PageDescriptor}&quot;
                GroupFootersVisibility=&quot;Visible&quot; GroupByBoxVisibility=&quot;Visible&quot;
                CanUserAdd=&quot;true&quot; 
                CanUserDelete=&quot;true&quot;
                CanUserEdit=&quot;true&quot;
                NewItem=&quot;{Binding NewProduct, Mode=TwoWay}&quot;
                SelectedItem=&quot;{Binding SelectedProduct, Mode=TwoWay}&quot;
                ValidateRowCommand=&quot;{Binding ValidateRowCommand}&quot;
                InsertRowCommand=&quot;{Binding InsertRowCommand}&quot;
                DeleteRowCommand=&quot;{Binding DeleteRowCommand}&quot;
                PrepareNewRowCommand=&quot;{Binding PrepareNewRowCommand}&quot;
                UpdateCellCommand=&quot;{Binding UpdateCellCommand}&quot;
                UpdateRowCommand=&quot;{Binding UpdateRowCommand}&quot;
                SaveChangesCommand=&quot;{Binding SaveChangesCommand}&quot;
                RejectRowCommand=&quot;{Binding RejectRowCommand}&quot;
                RejectChangesCommand=&quot;{Binding RejectChangesCommand}&quot;
                HasChanges=&quot;{Binding HasChanges}&quot;&gt;

                &lt;Intersoft:UXGridView.GroupDescriptors&gt;
                    &lt;Intersoft:UXGridViewGroupDescriptor PropertyName=&quot;CategoryID&quot;/&gt;
                &lt;/Intersoft:UXGridView.GroupDescriptors&gt;

                &lt;Intersoft:UXGridView.Columns&gt;
                    &lt;Intersoft:UXGridViewTextColumn 
                        Header=&quot;Category ID&quot; 
                        Binding=&quot;{Binding CategoryID}&quot;/&gt;
                    &lt;Intersoft:UXGridViewTextColumn 
                        Header=&quot;Product ID&quot; 
                        Binding=&quot;{Binding ProductID}&quot; 
                        IsReadOnly=&quot;True&quot; 
                        Aggregate=&quot;Count&quot; 
                        FooterFormatString=&quot;Count = {0}&quot;/&gt;
                    &lt;Intersoft:UXGridViewTextColumn 
                        Header=&quot;Product Name&quot; 
                        Binding=&quot;{Binding ProductName}&quot;/&gt;
                    &lt;Intersoft:UXGridViewTextColumn 
                        Header=&quot;Units In Stock&quot; 
                        Binding=&quot;{Binding UnitsInStock}&quot; 
                        Aggregate=&quot;Max&quot; FooterFormatString=&quot;Max = {0}&quot;/&gt;
                    &lt;Intersoft:UXGridViewTextColumn 
                        Header=&quot;Unit Price&quot; 
                        Binding=&quot;{Binding UnitPrice}&quot; 
                        Aggregate=&quot;Avg&quot; 
                        FooterFormatString=&quot;Avg = {0:n2}&quot;/&gt;
                    &lt;Intersoft:UXGridViewTextColumn 
                        Header=&quot;Units On Order&quot; 
                        Binding=&quot;{Binding UnitsOnOrder}&quot; 
                        Aggregate=&quot;Min&quot; 
                        FooterFormatString=&quot;Min = {0}&quot;/&gt;
                    &lt;Intersoft:UXGridViewTextColumn 
                        Header=&quot;Quantity Per Unit&quot; 
                        Binding=&quot;{Binding QuantityPerUnit}&quot;/&gt;
                &lt;/Intersoft:UXGridView.Columns&gt;

            &lt;/Intersoft:UXGridView&gt;
            
        &lt;/Intersoft:DockPanel&gt;
    &lt;/Grid&gt;
&lt;/Intersoft:UXPage&gt;</pre><p></p>
<h3>Handling the CUD Operation in ViewModel Using DevForce</h3>
<p>After the commands are bound to the ViewModel, it is up to you how you want to handle the CUD operation. </p>
<p>If you prefer to automatically update the records after each CUD operation, you can do that in the InsertRowCommand, UpdateRowCommand and DeleteRowCommand respectively, and probably followed up by RefreshCommand to refresh the data. However, if you prefer a batch update, you can notify the UXGridView by setting the HasChanges property to True, and later call the SaveChanges method to perform the batch update.</p>
<p>This batch update capability might not be available in all data providers such as WCF RIA. When you enable server query in WCF RIA such as paging, sorting, and filtering; you always get a new fresh data from the database regardless of the changes in the client. This behavior is due to the WCF RIA not supporting client-side caching. In this case, you might want to do automatic update and/or refresh after each CUD operation. There are samples that show how to do this in our CTP package.</p>
<p>Next, I will show you how to handle the CUD Operation in the ViewModel. To save time, I will only cover the one using DevForce which allows you to enable batch update.</p>
<p>Since the sample used <strong>ProductsRepository</strong> to encapsulate all data operation, I&#8217;ll show you first what I&#8217;m doing in the <strong>ProductsRepository</strong>.</p>
<p></p><pre class="crayon-plain-tag">using System;
using System.Collections;
using System.ComponentModel;
using IdeaBlade.EntityModel;
using IdeaBlade.Validation;
using Intersoft.Client.Data.ComponentModel;
using Intersoft.Client.Data.Provider.DevForce;
using UXGridView.Samples.Data.DevForce;

namespace UXGridView.Samples.ModelServices
{
    public class ProductsRepository : IEditableDataRepository
    {
        public ProductsRepository(NorthwindEntities entityManager)
        {
            this.Manager = entityManager;
        }

        private static IDataRepository _repository;

        public static IDataRepository Instance
        {
            get
            {
                return _repository ?? (_repository = CreateRepository());
            }
            set
            {
                _repository = value;
            }
        }

        private NorthwindEntities Manager { get; set; }

        public static IDataRepository CreateRepository()
        {
            return new ProductsRepository(EntityManager.Create());
        }

        public void GetData(Action&lt;IEnumerable&gt; onSuccess, <br />                            Action&lt;Exception&gt; onFail)
        {
            this.Manager.Products
                .ExecuteAsync(
                op =&gt;
                {
                    if (op.CompletedSuccessfully)
                    {
                        if (onSuccess != null)
                            onSuccess(op.Results);
                    }
                    else
                    {
                        if (onFail != null)
                        {
                            op.MarkErrorAsHandled();
                            onFail(op.Error);
                        }
                    }
                }
               );
        }

        public void GetData(QueryDescriptor queryDescriptor, 
            Action&lt;IEnumerable&gt; onSuccess, 
            Action&lt;int&gt; onItemCountRetrieved, 
            Action&lt;Exception&gt; onFail)
        {
            this.Manager.Products.OrderBy(p =&gt; p.ProductID).Parse(queryDescriptor)
                .ExecuteAsync(
                op =&gt;
                {
                    if (op.CompletedSuccessfully)
                    {
                        if (onSuccess != null)
                            onSuccess(op.Results);

                        if (onItemCountRetrieved != null)
                            onItemCountRetrieved(-1); // not applicable;
                    }
                    else
                    {
                        if (onFail != null)
                        {
                            op.MarkErrorAsHandled();
                            onFail(op.Error);
                        }
                    }
                }
               );
        }

        public void GetTotalItemCount
            (QueryDescriptor queryDescriptor, 
            Action&lt;int&gt; onSuccess)
        {
            var op = this.Manager.Products
                .Parse(queryDescriptor, false).AsScalarAsync().Count();
            op.Completed += (o, e) =&gt;
            {
                if (onSuccess != null)
                    onSuccess(e.Result);
            };
        }

        public void Insert(object entity)
        {            
            this.Manager.AddEntity(entity);
        }

        public void Delete(IList entities)
        {
            foreach (object o in entities)
            {
                this.Delete(o);
            }
        }

        public void Delete(object entity)
        {
            Product product = entity as Product;
            product.EntityAspect.Delete();            
        }

        public void RejectChanges()
        {
            this.Manager.RejectChanges();
        }

        public void SaveChanges(
            Action onSuccess, 
            Action&lt;Exception&gt; onError)
        {
            this.Manager.SaveChangesAsync
            (
                op =&gt;
                {
                    if (op.IsCompleted)
                    {
                        if (op.HasError)
                        {
                            // handle error
                            op.MarkErrorAsHandled();
                            onError(op.Error);
                        }
                        else
                        {
                            onSuccess();
                        }
                    }
                },
                null
            );
        }

        public object Create()
        {
            return this.Manager.CreateEntity&lt;Product&gt;();
        }

        public void Validate(object entity)
        {
            Product product = (Product)entity;

            product.EntityAspect.ValidationErrors.Clear();
            product.EntityAspect.VerifierEngine.Execute(product);

            if (product.CategoryID &lt; 1 || product.CategoryID &gt; 8)
                product.EntityAspect.ValidationErrors
                    .Add(new VerifierResult(
                        VerifierResultCode.Error, 
                        &quot;Specified CategoryID does not exist&quot;, 
                        new string[] { &quot;CategoryID&quot; }));

            if (product.UnitPrice &lt; 0)
                product.EntityAspect.ValidationErrors
                    .Add(new VerifierResult
                        (VerifierResultCode.Error, 
                        &quot;Unit Price can not be less than 0&quot;, 
                        new string[] { &quot;UnitPrice&quot; }));

            if (product.UnitsInStock &lt; 0)
                product.EntityAspect.ValidationErrors
                    .Add(new VerifierResult(
                        VerifierResultCode.Error, 
                        &quot;Units in Stock can not be less than 0&quot;,
                        new string[] { &quot;UnitsInStock&quot; }));

            if (product.UnitsOnOrder &lt; 0)
                product.EntityAspect.ValidationErrors
                    .Add(new VerifierResult(
                        VerifierResultCode.Error, 
                        &quot;Units on Order can not be less than 0&quot;,
                        new string[] { &quot;UnitsOnOrder&quot; }));
        }

        public void RejectChanges(object entity)
        {
            IRevertibleChangeTracking revertible = <br />                                     (IRevertibleChangeTracking)entity;
<br />            revertible.RejectChanges();
        }
    }
}</pre><p></p>
<p>Finally, let’s handle the CUD commands in our ViewModel.</p>
<h3>For Create Operation </h3>
<p></p><pre class="crayon-plain-tag">public void ExecuteInsertRow(object parameter)
{
    this.NewProduct = null;

    if (!this.IsBatchUpdate)
        this.SaveChanges();
    else
        this.HasChanges = true;
}

public void ExecutePrepareNewRow(object parameter)
{

    // It's possible to initialize the new row with default values
    // Example:
    // product.ProductName = &quot;New Product&quot;;

    this.NewProduct = this.EditableProductsSource.Create();
    this.EditableProductsSource.Insert(this.NewProduct);
}</pre><p></p>
<h3>For Update Operation </h3>
<p></p><pre class="crayon-plain-tag">public void ExecuteUpdateCell(object parameter)
{
    object[] updateCellParameters = (object[])parameter;
    object product = updateCellParameters.GetValue(0);
    string property = updateCellParameters.GetValue(1).ToString();

    // perform cell-level validation if required
}

public void ExecuteUpdateRow(object parameter)
{
    if (!this.IsBatchUpdate)
        this.SaveChanges();
    else
        this.HasChanges = true;
}</pre><p></p>
<h3>For Delete Operation </h3>
<p></p><pre class="crayon-plain-tag">public void ExecuteDeleteRow(object parameter)
{
    this.EditableProductsSource.Delete(parameter as IList);

    if (!this.IsBatchUpdate)
        this.SaveChanges();
    else
        this.HasChanges = true;
}</pre><p></p>
<h3>For Validation, Reject Row and Refresh Operation </h3>
<p></p><pre class="crayon-plain-tag">public void SaveChanges()
{
    this.IsBusy = true;

    this.EditableProductsSource.SaveChanges
    (
        () =&gt;
        {
            this.IsRefreshed = true;
            this.LoadProducts(); // refresh
            this.HasChanges = false;
            this.IsBusy = false;
        },
        exception =&gt;
        {
            this.IsBusy = false;

            MessagePresenter presenter = new MessagePresenter();
            presenter.ShowErrorMessage(&quot;An unexpected error has occurred: &quot; <br />                       + exception.Message);
        }
    );
}

public void ExecuteValidateRow(object parameter)
{
    this.EditableProductsSource.Validate(parameter);
}

public void ExecuteRejectRow(object parameter)
{
    if (parameter != null)
        this.EditableProductsSource.RejectChanges(parameter);

    this.NewProduct = null;
}</pre><p></p>
<h3>For Batch Operation </h3>
<p></p><pre class="crayon-plain-tag">public void ExecuteRejectChanges(object parameter)
{
    this.EditableProductsSource.RejectChanges();
    this.HasChanges = false;
}

public void ExecuteSaveChanges(object parameter)
{
    // if users click on the save changes while the new row is being edited,
    // presume the new row isn't intended
    if (this.NewProduct != null)
        this.EditableProductsSource.RejectChanges(this.NewProduct);

    this.SaveChanges();
}</pre><p></p>
<p>I hope this post gives you a comprehensive understanding on handling the CUD (Create, Update, Delete) operation in UXGridView using MVVM design pattern. In the next post, I will blog about customizing editing controls in UXGridView, for instance, customizing the editing control of certain columns to more advanced input controls such as UXDateTimePicker, UXNumericUpDown, UXSliderBar, and so forth.</p>
<p>If you have any questions regarding the CUD operation, please post some questions in our <a href="http://www.intersoftpt.com/Community/">community</a> website.</p>
<p>Regards,<br />
  <br />Andry</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2011/02/uxgridview-part-4-data-editing-the-mvvm-way-with-commands/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>UXGridView CTP2: MVVM Data Editing</title>
		<link>http://blog.intersoftsolutions.com/2011/02/uxgridview-ctp2-mvvm-data-editing/</link>
		<comments>http://blog.intersoftsolutions.com/2011/02/uxgridview-ctp2-mvvm-data-editing/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 19:13:55 +0000</pubDate>
		<dc:creator><![CDATA[Jimmy Petrus]]></dc:creator>
				<category><![CDATA[2011 R1]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[ClientUI]]></category>
		<category><![CDATA[DevForce]]></category>
		<category><![CDATA[Editing]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[UXGridView]]></category>
		<category><![CDATA[WCF RIA Services]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">https://intersoftpt.wordpress.com/2011/02/21/uxgridview-ctp2-mvvm-data-editing/</guid>
		<description><![CDATA[Two weeks ago, we released the first CTP of our new data controls for Silverlight and WPF. The first CTP was focused on MVVM Grid architecture and server-based data access, as well as data operation such as paging and filtering. More information can be found [...]]]></description>
				<content:encoded><![CDATA[<img width="466" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2014/09/image_thumb43-604x350.png" class="attachment-post-thumbnail wp-post-image" alt="Intuitive row validation" style="float:right; margin:0 0 10px 10px;" /><p>Two weeks ago, we released the <a href="http://intersoftpt.wordpress.com/2011/02/07/introducing-uxgridview-the-mvvm-ready-grid-for-silverlight-and-wpf/" target="_blank">first CTP</a> of our new data controls for Silverlight and WPF. The first CTP was focused on MVVM Grid architecture and server-based data access, as well as data operation such as paging and filtering. More information can be found <a href="http://intersoftpt.wordpress.com/2011/02/09/uxgridview-part-ii-data-access-the-mvvm-way-with-querydescriptor/" target="_blank">here</a>.</p>
<p>Today, I’m excited to announce the availability of the second CTP of our data controls. Our milestone in this release is strongly focused on data validation and data editing that supports MVVM design pattern. The release also includes a number of great features like batch update support for DevForce data service, native ValueList support for display and edit mode, customizable editing controls, and a host of UI/X tweaking.</p>
<p>Click <a href="http://www.intersoftpt.com/ClientUI/Intersoft.ClientUI.Data.CTP2.zip" target="_blank">here</a> to download the CTP2, and read the details below to discover what’s new.</p>
<h2>Data Validation &amp; Editing with MVVM Pattern</h2>
<p>For decades, developers have to write a bunch of code to implement an editable grid, from wiring editing events to writing validation code in a number of places. That’s even true for the latest built-in Silverlight DataGrid, for instances, you should write code to perform data validation in the <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid.roweditended%28v=vs.95%29.aspx" target="_blank">RowEditEnded</a> event. This pattern of development, unfortunately, makes your code difficult to test and maintain. And it definitely violates the MVVM pattern as the event wiring requires a strong reference to the view elements.</p>
<p>Unlike other Silverlight grids, UXGridView supports MVVM-style data editing out-of-the-box. It allows you to write data validation and editing logic entirely in the ViewModel without trading-off the rich editing features in the grid. The benefits of using MVVM in data editing applications are obvious – you can easily reuse, test and extend the interactions logics in the ViewModel without affecting the view or data access layers.</p>
<p>With UXGridView, you don’t wire events in order to perform data validation. While we still provided routed events as a mean to work with the Grid using the classic MVP pattern, it’s unnecessary to wire any editing events to perform editing operations such as begin, commit or cancel edit. Implementing data validation and editing using MVVM pattern is simple and straightforward. First, you create the delegate commands for each editing command in the ViewModel, then bind the commands to the UXGridView through data binding declaration.</p>
<p>The following illustration shows a simple MVVM implementation of data validation and editing in UXGridView.</p>
<p>  </p><pre class="crayon-plain-tag"><strong>ViewModel:</strong>

 public DelegateCommand DeleteRowCommand { get; set; }
 public DelegateCommand InsertRowCommand { get; set; }
 public DelegateCommand UpdateRowCommand { get; set; }
 public DelegateCommand ValidateRowCommand { get; set; }

 public void ExecuteValidateRow(object parameter)
 {
      this.EditableProductsSource.Validate(parameter);
 }

public void ExecutePrepareNewRow(object parameter)
{
    this.NewProduct = this.EditableProductsSource.Create();
    this.EditableProductsSource.Insert(this.NewProduct);
}

public void ExecuteDeleteRow(object parameter)
{
    this.EditableProductsSource.Delete(parameter as IList);
}

 ...

<strong>XAML Page:</strong>

 &lt;Intersoft:UXGridView ItemsSource=&quot;{Binding Products}&quot; 
              CanUserAdd=&quot;True&quot; 
              CanUserDelete=&quot;True&quot;
              CanUserEdit=&quot;True&quot;
              SelectedItem=&quot;{Binding SelectedProduct, Mode=TwoWay}&quot;
              ValidateRowCommand=&quot;{Binding ValidateRowCommand}&quot;
              InsertRowCommand=&quot;{Binding InsertRowCommand}&quot;
              DeleteRowCommand=&quot;{Binding DeleteRowCommand}&quot;
              UpdateRowCommand=&quot;{Binding UpdateRowCommand}&quot; /&gt;</pre><p></p>
<p>As you can see from the above code snippet, the beautiful of the MVVM pattern is that you have full control over your business and interaction logic. For example, if you used a powerful data service like DevForce, you can simply delegate the call to a repository that automatically execute the validation to the given entity.</p>
<p>You really don’t need to worry about the change tracking, dirty state, or valid state – the UXGridView takes care of them automatically. For an instance, when the modified row contains validation errors, UXGridView will not allow you to commit the changes until you correct the error, or cancel the changes – see the screenshot below.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/02/image4.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Intuitive row validation" border="0" alt="Intuitive row validation" src="http://intersoftpt.files.wordpress.com/2011/02/image_thumb4.png" width="642" height="365" /></a></p>
<p>In addition to the solid MVVM-ready editing architecture, UXGridView also sports great looking interface, which includes a handy error message displayed in the status bar, as well as error notification in the row and row header.</p>
<h2>New Row &amp; Delete </h2>
<p>You asked for it, we deliver! The new UXGridView brings back the features you loved to use such as the “new row” interface for quick data adding, inline editing, and delete row support. While these features sound common in most ASP.NET grids, they aren’t in Silverlight, so we built one.</p>
<p>The &quot;new row” interface works pretty much similar to the ASP.NET version of our flagship WebGrid. You click on the new row bar to begin adding new rows. Keyboard arrow keys are also fully supported for navigating to the new row.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/02/image5.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="New row interface" border="0" alt="New row interface" src="http://intersoftpt.files.wordpress.com/2011/02/image_thumb5.png" width="642" height="366" /></a></p>
<p>The other nice feature is the support for multiple selection and row delete. The multiple selection is enabled by default, so you can easily select multiple rows by using the combination of Ctrl and Shift keys. Once selected, press Delete to delete the selection.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/02/image6.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Multiple selection" border="0" alt="Multiple selection" src="http://intersoftpt.files.wordpress.com/2011/02/image_thumb6.png" width="642" height="361" /></a></p>
<h2>Batch Update Support for DevForce</h2>
<p>If you noticed on the above screenshots close enough, chances are that you’ll spot two interesting buttons beside the pager control. Think you’ve seen these buttons before? Well, you must have seen it in the batch update feature we implemented in the ASP.NET version of our WebGrid.</p>
<p>If you haven’t heard much about batch update, it is a very powerful feature in data-aware applications which allows you to make multiple edits locally and submit them in a single round trip. Unfortunately, the batch update implementation in Silverlight is fairly challenging since the UXGridView control should not be tightly coupled to any data access strategy. This means that the batch update should be supported by the data service provider as well.</p>
<p>Luckily, DevForce from <a href="http://www.ideablade.com" target="_blank">IdeaBlade</a> includes full support for batch update, thanks to their client-side caching feature. The WCF RIA Services, on the other hands, has very limited support for batch update, you might notice the options to be disabled in several editing samples for RIA.</p>
<p>When the batch update feature is enabled, all changes you made in the UXGridView will be kept locally. Consequently, your implementation for the Insert, Update and Delete in the ViewModel is not required to call the Save method. This, and many other benefits, make batch update an ideal approach to your data intensive applications as data input becomes more responsive and faster with reduced server-client round trip.</p>
<p>The changes you made in the grid can be submitted to server in batch through the SaveChanges command; or rejected through the RejectChanges command. The UXGridView control provides default buttons in the status bar interface which execute these commands, see the illustration below.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/02/image7.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Batch update commands" border="0" alt="Batch update commands" src="http://intersoftpt.files.wordpress.com/2011/02/image_thumb7.png" width="642" height="368" /></a></p>
<p>The SaveChanges and RejectChanges commands will be automatically disabled when they cannot execute. For instances, when the grid is busy, or when the grid has no more changes. Again, this process is controlled from your ViewModel through the binding to the HasChanges property in UXGridView.</p>
<p>You can also explore a bunch of editing behaviors implemented in the UXGridView. In the DevForce samples, you can try to use inline or batch update mode via the Options panel, see below.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/02/image8.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Sample options" border="0" alt="Sample options" src="http://intersoftpt.files.wordpress.com/2011/02/image_thumb8.png" width="642" height="177" /></a></p>
<h2>Customizable Editing Controls</h2>
<p>Now that we’ve got MVVM-ready editing architecture covered, as well as the editing behaviors like the enter key action and edit mouse gesture, the CTP2 release also shipped with powerful editing architecture that you’ll definitely excited to see. </p>
<p>Unlike other grid controls that require you to write specific interface to properly work in editing mode, we introduced editing cell template that allows you to use any existing input controls as the editing control for that specific column.</p>
<p>One of my favorite features is the easy plug-in to use the advanced input controls we introduced in the previous release such as UXNumericUpDown, UXDateTimePicker, UXCurrencyEdit and UXSliderBar just to name a few. For an instance, the following code shows how to use the UXNumericUpDown control as the editing control for UnitsInStock column:</p>
<p></p><pre class="crayon-plain-tag">&lt;Intersoft:UXGridViewTextColumn Header=&quot;Units In Stock&quot;
                                 Binding=&quot;{Binding UnitsInStock}&quot;&gt;
     &lt;Intersoft:UXGridViewTextColumn.CellEditingTemplate&gt;
         &lt;DataTemplate&gt;
             &lt;Intersoft:UXNumericUpDown Maximum=&quot;9999&quot; 
                        Value=&quot;{Binding UnitsInStock, Mode=TwoWay}&quot;/&gt;
         &lt;/DataTemplate&gt;
     &lt;/Intersoft:UXGridViewTextColumn.CellEditingTemplate&gt;
 &lt;/Intersoft:UXGridViewTextColumn&gt;</pre><p></p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/02/image9.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Using UXNumericUpDown as editing control" border="0" alt="Using UXNumericUpDown as editing control" src="http://intersoftpt.files.wordpress.com/2011/02/image_thumb9.png" width="642" height="38" /></a></p>
<p>You can also use a more unique, non-textbox input control such as UXSliderBar, by simply defining the control in the CellEditingTemplate similar to the above example.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/02/image10.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Using UXSliderBar as editing control" border="0" alt="Using UXSliderBar as editing control" src="http://intersoftpt.files.wordpress.com/2011/02/image_thumb10.png" width="642" height="34" /></a></p>
<p>The release also includes many other exciting features such as native ValueList support on both cell and editing mode, column template, and editing template selector. More on these in the next post.</p>
<h2>Download the CTP2 Bits</h2>
<p>Click <a href="http://www.intersoftpt.com/ClientUI/Intersoft.ClientUI.Data.CTP2.zip" target="_blank">here</a> to download the CTP2 and test-drive the new UXGridView features today. The download package includes latest ClientUI assemblies as well as updated and new samples for both Silverlight and WPF platforms.</p>
<p>Make sure you checked out the new samples shipped in this CTP2 release, see the red-highlighted sections below.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/02/image11.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="New samples" border="0" alt="New samples" src="http://intersoftpt.files.wordpress.com/2011/02/image_thumb11.png" width="642" height="460" /></a></p>
<p>Enjoy the new CTP bits! In the next several posts, we will cover more code-level details and usages on the UXGridView related to the editing features, so stay tuned.</p>
<p>We’d love to hear what you think about the new features available in CTP2, please post your feedback, questions or issues to our <a href="http://www.intersoftpt.com/Community/ClientUI">community forum</a>.</p>
<p>All the best,<br />
  <br />Jimmy </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2011/02/uxgridview-ctp2-mvvm-data-editing/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>UXGridView Part 3: Fundamental Grid Features</title>
		<link>http://blog.intersoftsolutions.com/2011/02/uxgridview-part-3-fundamental-grid-features/</link>
		<comments>http://blog.intersoftsolutions.com/2011/02/uxgridview-part-3-fundamental-grid-features/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 10:31:26 +0000</pubDate>
		<dc:creator><![CDATA[ansoesil]]></dc:creator>
				<category><![CDATA[2011 R1]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[ClientUI]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[UXGridView]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://intersoftpt.wordpress.com/?p=2112</guid>
		<description><![CDATA[The core feature-sets that we wanted to focus in the first data controls CTP are the QueryDescriptor component model, and the fundamental grid architecture/features such as high-performance virtualization, adaptable layout, drag and drop, grouping and much more. In my previous post, I&#8217;ve explained how to [...]]]></description>
				<content:encoded><![CDATA[<p>The core feature-sets that we wanted to focus in the first data controls CTP are the QueryDescriptor component model, and the fundamental grid architecture/features such as high-performance virtualization, adaptable layout, drag and drop, grouping and much more. In my <a href="http://intersoftpt.wordpress.com/2011/02/09/uxgridview-part-ii-data-access-the-mvvm-way-with-querydescriptor/">previous post</a>, I&#8217;ve explained how to use QueryDescriptor which greatly simplify server data access using MVVM design pattern. Now, I will share some of the fundamental grid features that already available in the first CTP, and what you can expect in the next release.</p>
<h2>Virtualization</h2>
<p>One of the most fundamental features in UXGridView is its high-performance virtualization (virtual rendering) architecture. This means that the UXGridView doesn’t actually render all the data passed to it. Instead, it implements a smart logic which virtually render the data based on the available view port and the current scroll position. This virtualization feature is applied to all types of cells and rows rendering including the RowGroupHeader and RowGroupFooter, so that you can expect a blazing fast and scalable grid control for your applications.</p>
<p>You can try to bind the UXGridView with an unbound collection that holds million of rows as follows.</p>
<p>  </p><pre class="crayon-plain-tag">public class Data
{
    public string Column1 { get; set; }
    public string Column2 { get; set; }
    public string Column3 { get; set; }
    public string Column4 { get; set; }
    public string Column5 { get; set; }
    public string Column6 { get; set; }
    public string Column7 { get; set; }
    public string Column8 { get; set; }
    public string Column9 { get; set; }
    public string Column10 { get; set; }
    public string Column11 { get; set; }
    public string Column12 { get; set; }
    public string Column13 { get; set; }
    public string Column14 { get; set; }
    public string Column15 { get; set; }
    public string Column16 { get; set; }
    public string Column17 { get; set; }
    public string Column18 { get; set; }
    public string Column19 { get; set; }
    public string Column20 { get; set; }
    public string Column21 { get; set; }
    public string Column22 { get; set; }
    public string Column23 { get; set; }
    public string Column24 { get; set; }
    public string Column25 { get; set; }
    public string Column26 { get; set; }
    public string Column27 { get; set; }
    public string Column28 { get; set; }
    public string Column29 { get; set; }
    public string Column30 { get; set; }
}

public partial class SilverlightControl1 : UserControl
{
    public SilverlightControl1()
    {
        InitializeComponent();

        ObservableCollection
 data = new ObservableCollection();
        for (int i = 0; i &lt; 1000000; i++)
        {
            Data d = new Data()
            {
                Column1 = &quot;Data1&quot;,
                Column2 = &quot;Data2&quot;,
                Column3 = &quot;Data3&quot;,
                Column4 = &quot;Data4&quot;,
                Column5 = &quot;Data5&quot;,
                Column6 = &quot;Data6&quot;,
                Column7 = &quot;Data7&quot;,
                Column8 = &quot;Data8&quot;,
                Column9 = &quot;Data9&quot;,
                Column10 = &quot;Data10&quot;,
                Column11 = &quot;Data11&quot;,
                Column12 = &quot;Data12&quot;,
                Column13 = &quot;Data13&quot;,
                Column14 = &quot;Data14&quot;,
                Column15 = &quot;Data15&quot;,
                Column16 = &quot;Data16&quot;,
                Column17 = &quot;Data17&quot;,
                Column18 = &quot;Data18&quot;,
                Column19 = &quot;Data19&quot;,
                Column20 = &quot;Data20&quot;,
                Column21 = &quot;Data21&quot;,
                Column22 = &quot;Data22&quot;,
                Column23 = &quot;Data24&quot;,
                Column24 = &quot;Data25&quot;,
                Column25 = &quot;Data25&quot;,
                Column26 = &quot;Data26&quot;,
                Column27 = &quot;Data27&quot;,
                Column28 = &quot;Data28&quot;,
                Column29 = &quot;Data29&quot;,
                Column30 = &quot;Data30&quot;
            };

            data.Add(d);
        }

        this.uXGridView1.ItemsSource = data;
    }
}</pre><p></p>
<p>Notice that the overall UXGridView performance is based on the view port, the smaller the view port the less objects need to be rendered, thus it will perform faster.</p>
<h2>Adaptable Layout (Dynamic Row Height)</h2>
<p>Since rows and cells can be represented in many ways, we included a nice feature to support dynamic row height in the virtualization logic. This feature enables you to use a wrapped textblock for the cell, or using a fluid template for the Row and RowDetail without compromising the virtualization feature. Several examples of this feature were already available in the <a href="http://www.intersoftpt.com/ClientUI/Intersoft.ClientUI.Data.Samples.zip">downloadable CTP</a> that you can play around.</p>
<p>To enable text wrapping in the cell, right now you need to customize the CellStyle and add a TextBlock with TextWrapping property enabled. In the next release, we will add a built-in property directly in the UXGridViewColumn to easily enable text wrapping.</p>
<h2>Drag and Drop (Column and Group Reordering)</h2>
<p>Drag-drop interaction is commonly found in a number of Grid operations such as column reordering, and group manipulation like adding group, removing group or reordering group. Thanks to ClientUI’s robust DragDrop Framework, we can quickly provide fluid drag-drop capabilities in the UXGridView. You can find more exciting UX features related to the drag-drop in the next and third milestone of the CTP release.</p>
<h2>Data Grouping</h2>
<p>If you are wondering why GroupDescriptors is not included in the QueryDescriptor, it’s because data grouping is considered to be a client operation rather than a server operation. To group a data in runtime, you drag a column header and drop it onto the GroupByBox element which you can enable through the GroupByBoxVisibility property. </p>
<p>You can also add some predefined group declaratively as follows.</p>
<p></p><pre class="crayon-plain-tag">&lt;Intersoft:UXGridView Name=&quot;uXGridView1&quot; GroupByBoxVisibility=&quot;Visible&quot;&gt;                        
    &lt;Intersoft:UXGridView.GroupDescriptors&gt;
        &lt;Intersoft:UXGridViewGroupDescriptor PropertyName=&quot;CategoryID&quot;/&gt;
        &lt;Intersoft:UXGridViewGroupDescriptor PropertyName=&quot;SupplierID&quot;/&gt;
    &lt;/Intersoft:UXGridView.GroupDescriptors&gt;                                    
&lt;/Intersoft:UXGridView&gt;</pre><p></p>
<h3>Group Total and Aggregates</h3>
<p>In addition to the data grouping, we also introduced GroupFooter which represent the aggregate values of a specific column for a specific group. There are five built-in aggregates supported in UXGridView which are: Average, Sum, Count, Min and Max. A more advanced, customized aggregate function is also planned in the next CTP release, which leverage the use of MVVM and multi-binding.</p>
<p>The following example shows how to enable the group footers, and specify the aggregate function for certain columns.</p>
<p></p><pre class="crayon-plain-tag">&lt;Intersoft:UXGridView Name=&quot;uXGridView1&quot; GroupByBoxVisibility=&quot;Visible&quot;
                        GroupFootersVisibility=&quot;Visible&quot;&gt;                        
    &lt;Intersoft:UXGridView.GroupDescriptors&gt;
        &lt;Intersoft:UXGridViewGroupDescriptor PropertyName=&quot;CategoryID&quot;/&gt;
        &lt;Intersoft:UXGridViewGroupDescriptor PropertyName=&quot;SupplierID&quot;/&gt;
    &lt;/Intersoft:UXGridView.GroupDescriptors&gt;                    
    &lt;Intersoft:UXGridView.Columns&gt;
        &lt;Intersoft:UXGridViewTextColumn 
            Binding=&quot;{Binding Path=ProductID}&quot; 
            Header=&quot;Product ID&quot; /&gt;
        &lt;Intersoft:UXGridViewTextColumn 
            Binding=&quot;{Binding Path=CategoryID}&quot; 
            Header=&quot;Category ID&quot;/&gt;
        &lt;Intersoft:UXGridViewTextColumn 
            Binding=&quot;{Binding Path=SupplierID}&quot;
            Header=&quot;Supplier ID&quot;/&gt;
        &lt;Intersoft:UXGridViewTextColumn 
            Binding=&quot;{Binding Path=ProductName}&quot; 
            Header=&quot;Product Name&quot;/&gt;
        &lt;Intersoft:UXGridViewTextColumn 
            Binding=&quot;{Binding Path=UnitPrice}&quot; 
            Header=&quot;Unit Price&quot; Aggregate=&quot;Avg&quot;/&gt;
        &lt;Intersoft:UXGridViewTextColumn 
            Binding=&quot;{Binding Path=UnitsInStock}&quot; 
            Header=&quot;Units In Stock&quot; Aggregate=&quot;Sum&quot;/&gt;
        &lt;Intersoft:UXGridViewTextColumn 
            Binding=&quot;{Binding Path=UnitsOnOrder}&quot; 
            Header=&quot;Units On Order&quot; Aggregate=&quot;Count&quot;/&gt;
    &lt;/Intersoft:UXGridView.Columns&gt;
&lt;/Intersoft:UXGridView&gt;</pre><p></p>
<h2>Upcoming UXGridView Features</h2>
<p>In this post, you have learned some of the fundamental features available in UXGridView, such as virtualization, grouping, adaptable layout and drag-drop. We are currently topping off the rest of the features expected to ship in the CTP2 release due next week. One of the most exciting features is the unique data editing capability leveraging sophisticated custom editor concept and commanding. This will allow you to easily updating your data to the repository using MVVM design pattern. Stay tuned for our next announcement!</p>
<p>Best Regards,<br />
  <br />Andry</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2011/02/uxgridview-part-3-fundamental-grid-features/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UXGridView Part II: Data Access the MVVM-way with QueryDescriptor</title>
		<link>http://blog.intersoftsolutions.com/2011/02/uxgridview-part-ii-data-access-the-mvvm-way-with-querydescriptor/</link>
		<comments>http://blog.intersoftsolutions.com/2011/02/uxgridview-part-ii-data-access-the-mvvm-way-with-querydescriptor/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 10:05:22 +0000</pubDate>
		<dc:creator><![CDATA[ansoesil]]></dc:creator>
				<category><![CDATA[2011 R1]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[ClientUI]]></category>
		<category><![CDATA[DevForce]]></category>
		<category><![CDATA[MVVM]]></category>
		<category><![CDATA[QueryDescriptor]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[UXGridView]]></category>
		<category><![CDATA[WCF RIA Services]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://intersoftpt.wordpress.com/?p=2074</guid>
		<description><![CDATA[As Jimmy wrote in his blog post, our upcoming Grid control for Silverlight and WPF, UXGridView, allows you to perform data operation with MVVM pattern elegantly using QueryDescriptor. In this post, I will explain some of fundamental concepts of the QueryDescriptor in more practical ways. [...]]]></description>
				<content:encoded><![CDATA[<p>As Jimmy wrote in his <a href="http://intersoftpt.wordpress.com/2011/02/07/introducing-uxgridview-the-mvvm-ready-grid-for-silverlight-and-wpf/">blog post</a>, our upcoming Grid control for Silverlight and WPF, UXGridView, allows you to perform data operation with MVVM pattern elegantly using QueryDescriptor. In this post, I will explain some of fundamental concepts of the QueryDescriptor in more practical ways.</p>
<h2>Understanding QueryDescriptor</h2>
<p>First let’s take a look the QueryDescriptor class below.</p>
<p><img class="alignnone size-full wp-image-2083" title="QueryDescriptor Class" alt="QueryDescriptor Class" src="http://intersoftpt.files.wordpress.com/2011/02/gridview2_image1.png" width="399" height="248" /></p>
<p>As you can see, the QueryDescriptor has three properties that hold the information about the query. It also has a QueryChanged event that will be raised when any of the QueryDescriptor’s properties are changed. The following illustration shows some examples on how query information is stored in the QueryDescriptor.</p>
<p>  </p><pre class="crayon-plain-tag">QueryDescriptor queryDescriptor = new QueryDescriptor();

// filtering
// get records that have 
// (UnitPrice &gt;= 0 AND UnitPrice &lt; 50) OR (UnitPrice == 0)
CompositeFilterDescriptorCollection groupFilter1 = 
    new CompositeFilterDescriptorCollection();

groupFilter1.LogicalOperator = FilterCompositionLogicalOperator.And;
groupFilter1.Add(
    new FilterDescriptor() 
    { 
        PropertyName = &quot;UnitPrice&quot;, 
        Operator = FilterOperator.IsGreaterThanOrEqualTo, Value = 0 
    }
);
groupFilter1.Add(
    new FilterDescriptor() 
    { 
        PropertyName = &quot;UnitPrice&quot;, 
        Operator = FilterOperator.IsLessThan, Value = 50 
    }
);

CompositeFilterDescriptorCollection groupFilter2 = 
    new CompositeFilterDescriptorCollection();

groupFilter2.LogicalOperator = FilterCompositionLogicalOperator.And;
groupFilter2.Add(
    new FilterDescriptor() 
    { 
        PropertyName = &quot;UnitsInStock&quot;, 
        Operator = FilterOperator.IsEqualTo, Value = 0 
    }
);

queryDescriptor.FilterDescriptors.LogicalOperator = 
    FilterCompositionLogicalOperator.Or;

queryDescriptor.FilterDescriptors.Add(groupFilter1);
queryDescriptor.FilterDescriptors.Add(groupFilter2);

// paging
// get the record 6 - 10
queryDescriptor.PageDescriptor.PageSize = 5;
queryDescriptor.PageDescriptor.PageIndex = 1;

// sorting
// sort by category ascending then by product id descending
queryDescriptor.SortDescriptors.Add(
    new SortDescriptor() 
    { 
        PropertyName = &quot;CategoryID&quot;, 
        Direction = System.ComponentModel.ListSortDirection.Ascending 
    }
);
queryDescriptor.SortDescriptors.Add(
    new SortDescriptor() 
    { 
        PropertyName = &quot;ProductID&quot;, 
        Direction = System.ComponentModel.ListSortDirection.Descending 
    }
);</pre><p></p>
<p>With our data controls, the QueryDescriptor will be updated automatically whenever users perform data operations through our data controls such as paging, filtering and sorting. So all you need to do here is simply wiring up the QueryDescriptor to the data controls and listen to its QueryChanged event.</p>
<p>In the QueryChanged function delegate, you will need to parse the information in QueryDescriptor to a data operation command for your specific data source. Fortunately, our data provider libraries come with some methods allowing you to easily parse the QueryDescriptor into WCF RIA or DevForce data service.</p>
<p>Next, I will show you how to bind the QueryDescriptor to UXGridView, listen to its QueryChanged and perform the data operation.</p>
<h2>Binding QueryDescriptor to UXGridView using MVVM Pattern</h2>
<p>First, let’s create the ViewModel for our example.</p>
<p></p><pre class="crayon-plain-tag">using System.Collections.Specialized;
using Intersoft.Client.Data.ComponentModel;

namespace UXGridView.Samples.ViewModels
{
    public class ListProductsViewModel : ViewModelBase
    {
        public ListProductsViewModel()
        {
            this._queryDescriptor = new QueryDescriptor();
        }

        private INotifyCollectionChanged _products;
        private QueryDescriptor _queryDescriptor;

        public INotifyCollectionChanged Products
        {
            get { return this._products; }
            set
            {
                if (this._products != value)
                {
                    this._products = value;
                    this.OnPropertyChanged(&quot;Products&quot;);
                }
            }
        }

        public QueryDescriptor QueryDescriptor
        {
            get
            {
                return this._queryDescriptor;
            }
            set
            {
                if (this._queryDescriptor != value)
                {
                    if (this._queryDescriptor != null)
                        this._queryDescriptor.QueryChanged 
                            -= new System.EventHandler(OnQueryChanged);

                    this._queryDescriptor = value;
                    this._queryDescriptor.QueryChanged 
                        += new System.EventHandler(OnQueryChanged);

                    this.OnPropertyChanged(&quot;QueryDescriptor&quot;);
                }
            }
        }

        public virtual void LoadProducts()
        {

        }

        private void OnQueryChanged(object sender, System.EventArgs e)
        {
            this.LoadProducts();
        }
    }
}</pre><p></p>
<p>Notice that the LoadProducts() is still empty now, we&#8217;ll get to that later. Next we will bind this to our UXGridView in our View.</p>
<p></p><pre class="crayon-plain-tag">&lt;Intersoft:UXPage
	xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
	xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
	xmlns:d=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;
	xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
	mc:Ignorable=&quot;d&quot;
	xmlns:Intersoft=&quot;http://intersoft.clientui.com/schemas&quot;
        xmlns:ViewModels=&quot;clr-namespace:UXGridView.Samples.ViewModels&quot;
	x:Class=&quot;UXGridView.Samples.Views.UXGridView.ListProducts&quot;
	Title=&quot;ListProducts Page&quot;
	d:DesignWidth=&quot;640&quot; d:DesignHeight=&quot;480&quot;&gt;

    &lt;Grid x:Name=&quot;LayoutRoot&quot;&gt;
        &lt;Grid.DataContext&gt;
            &lt;ViewModels:ListProductsViewModel/&gt;
        &lt;/Grid.DataContext&gt;

        &lt;Grid MaxWidth=&quot;700&quot; Margin=&quot;12&quot;&gt;
            &lt;Intersoft:UXGridView 
                Margin=&quot;8&quot; AutoGenerateColumns=&quot;False&quot; 
                ItemsSource=&quot;{Binding Products}&quot;
                QueryOperation=&quot;Server&quot;
                SortDescriptors=&quot;{Binding QueryDescriptor.SortDescriptors}&quot;
                PageDescriptor=&quot;{Binding QueryDescriptor.PageDescriptor}&quot; 
                PageSize=&quot;20&quot; CanUserPage=&quot;True&quot;&gt;
                &lt;Intersoft:UXGridView.Columns&gt;
                    &lt;Intersoft:UXGridViewTextColumn 
                        Header=&quot;Category ID&quot; 
                        Binding=&quot;{Binding CategoryID}&quot;/&gt;
                    &lt;Intersoft:UXGridViewTextColumn 
                        Header=&quot;Product ID&quot; 
                        Binding=&quot;{Binding ProductID}&quot; 
                        Aggregate=&quot;Count&quot; FooterFormatString=&quot;Count = {0}&quot;/&gt;
                    &lt;Intersoft:UXGridViewTextColumn 
                        Header=&quot;Product Name&quot; 
                        Binding=&quot;{Binding ProductName}&quot;/&gt;
                    &lt;Intersoft:UXGridViewTextColumn 
                        Header=&quot;Unit Price&quot; 
                        Binding=&quot;{Binding UnitPrice}&quot; 
                        Aggregate=&quot;Avg&quot; FooterFormatString=&quot;Avg = {0}&quot;/&gt;
                    &lt;Intersoft:UXGridViewTextColumn 
                        Header=&quot;Units In Stock&quot; 
                        Binding=&quot;{Binding UnitsInStock}&quot; 
                        Aggregate=&quot;Max&quot; FooterFormatString=&quot;Max = {0}&quot;/&gt;
                    &lt;Intersoft:UXGridViewTextColumn 
                        Header=&quot;Units On Order&quot; 
                        Binding=&quot;{Binding UnitsOnOrder}&quot; 
                        Aggregate=&quot;Min&quot; FooterFormatString=&quot;Min = {0}&quot;/&gt;
                    &lt;Intersoft:UXGridViewTextColumn 
                        Header=&quot;Quantity Per Unit&quot; 
                        Binding=&quot;{Binding QuantityPerUnit}&quot;/&gt;
                &lt;/Intersoft:UXGridView.Columns&gt;
            &lt;/Intersoft:UXGridView&gt;
        &lt;/Grid&gt;
    &lt;/Grid&gt;
&lt;/Intersoft:UXPage&gt;</pre><p></p>
<p>Note that you will need to set the QueryOperation to Server to enable server-side data operation. That’s required because UXGridView also has the capability to manipulate the data at client side, which is the default setting. For now, let’s focus on the server-side query mode.</p>
<p>The QueryChanged event of the QueryDescriptor will be raised when it is bind to any of our data controls such as UXGridView, UXDataFilter or UXDataPager. The event will also be raised whenever there are changes in the QueryDescriptor, so it is the only place where you want to handle all data operations.</p>
<p>Now, let’s start processing this QueryDescriptor and retrieve a piece of data from our repository.</p>
<h2>Parsing QueryDescriptor and Retrieving Data from WCF RIA</h2>
<p>To parse the QueryDescriptor to WCF RIA, you need to include the Intersoft.Client.Data.Provider.Ria assembly in your project. This data provider assembly provides several methods that will allow you to easily parse the QueryDescriptor to the WCF RIA data service.</p>
<p>Now, let’s parse our QueryDescriptor and write some code to load the data in the LoadProducts() method that we&#8217;ve prepared in the previous section.</p>
<p></p><pre class="crayon-plain-tag">private NorthwindDomainContext _manager;
private NorthwindDomainContext Manager
{
    get
    {
        if (this._manager == null)
            this._manager = new NorthwindDomainContext();

        return this._manager;
    }
}

public virtual void LoadProducts()
{
    if (Intersoft.Client.Framework.ISControl.IsInDesignModeStatic)
        return;

<strong>
    var query = this.Manager.GetProductsQuery()
                         .OrderBy(p =&gt; p.ProductID)
                         .Parse(this.QueryDescriptor);
    query.IncludeTotalCount = true;
</strong>

    this.Manager.Load(
        query,
        op =&gt;
        {
            if (op.IsComplete)
            {
                this.Products = new PagedCollectionView(op.Entities);
                if (op.TotalEntityCount != -1)
                    this.QueryDescriptor.PageDescriptor.TotalItemCount 
                        = op.TotalEntityCount;
            }
            else
            {
                // error handling
            }
        },

        true);
}

private void OnQueryChanged(object sender, System.EventArgs e)
{
    this.LoadProducts();
}</pre><p></p>
<p>As you can see, the implementation is very straightforward, you just need to call <strong>.Parse(this.QueryDescriptor)</strong> to produce a query that WCF RIA can process. Note that <strong>IncludeTotalCount</strong> is set to True, which is important in paging scenarios as we will need to set the <strong>QueryDescriptor.PageDescriptor.TotalItemCount </strong>property to the total entity count of the particular query<strong>. </strong>This enables the data pager UI to determine the total number of pages available.</p>
<h2>Parsing QueryDescriptor and Retrieving Data from Dev Force</h2>
<p>In addition to the WCF RIA, you can also parse the QueryDescriptor to a DevForce service using similar approaches, with minor adjustments. First, you need to include the Intersoft.Client.Data.Provider.DevForce assembly in your project. This data provider provides similar methods as available in the RIA counterpart. Next, you need to adjust some of the code such as declaring the relavant DevForce type, see below.</p>
<p></p><pre class="crayon-plain-tag">private NorthwindEntities _manager;
private NorthwindEntities Manager
{
    get
    {
        if (this._manager == null)
            this._manager = new NorthwindEntities();

        return this._manager;
    }
}

public virtual void LoadProducts()
{
    if (Intersoft.Client.Framework.ISControl.IsInDesignModeStatic)
        return;

    <strong>this.Manager.Products
        .OrderBy(p =&gt; p.ProductID).Parse(this.QueryDescriptor)
        .ExecuteAsync(
        op =&gt;
        {
            if (op.CompletedSuccessfully)
            {
                this.Products = new PagedCollectionView(op.Results);
            }
            else
            {
                // error handling
            }
        }
        );  </strong>               
}

public virtual void GetTotalItemCount()
{
    <strong>var queryCount = this.Manager.Products
        .Parse(this.QueryDescriptor, false).AsScalarAsync().Count();

    queryCount.Completed += (o, e) =&gt;
    {
        if (e.Result != -1)
            this.QueryDescriptor.PageDescriptor.TotalItemCount = 
                e.Result;
    };    </strong>
}

private void OnQueryChanged(object sender, System.EventArgs e)
{
    this.GetTotalItemCount();
    this.LoadProducts();
}</pre><p></p>
<p>Notice that you need to retrieve the total item count in two separate calls. This is required since DevForce handles the total item count retrieval differently.</p>
<p>I hope you agree that the QueryDescriptor makes MVVM and data service significantly easier and straightforward to implement. Also, remember that the QueryDescriptor can be shared across multiple controls such as UXDataFilter and UXDataPager, in addition to the UXGridView.</p>
<p>In my next post, I will cover about some nice Grid features that we shipped in the first CTP release. For now, download the CTP1 bits <a href="http://www.intersoftpt.com/ClientUI/Intersoft.ClientUI.Data.Samples.zip">here</a>, and enjoy building your data-centric application the MVVM way.</p>
<p>Best Regards,<br />
  <br />Andry</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2011/02/uxgridview-part-ii-data-access-the-mvvm-way-with-querydescriptor/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Introducing UXGridView: The MVVM-ready Grid for Silverlight and WPF</title>
		<link>http://blog.intersoftsolutions.com/2011/02/introducing-uxgridview-the-mvvm-ready-grid-for-silverlight-and-wpf/</link>
		<comments>http://blog.intersoftsolutions.com/2011/02/introducing-uxgridview-the-mvvm-ready-grid-for-silverlight-and-wpf/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 12:24:24 +0000</pubDate>
		<dc:creator><![CDATA[Jimmy Petrus]]></dc:creator>
				<category><![CDATA[2011 R1]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[ClientUI]]></category>
		<category><![CDATA[DevForce]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[UXDataFilter]]></category>
		<category><![CDATA[UXDataPager]]></category>
		<category><![CDATA[UXGridView]]></category>
		<category><![CDATA[WCF RIA Services]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">https://intersoftpt.wordpress.com/2011/02/07/introducing-uxgridview-the-mvvm-ready-grid-for-silverlight-and-wpf/</guid>
		<description><![CDATA[A while back, I posted a blog that describes our plan to release a new Grid control to join our flagship ClientUI suite. One of the key goals of the new Grid control is to provide a full MVVM-ready data grid implementation that supports our [...]]]></description>
				<content:encoded><![CDATA[<img width="466" height="270" src="http://blog.intersoftsolutions.com/wp-content/uploads/2014/09/querydescriptor_thumb1-604x350.png" class="attachment-post-thumbnail wp-post-image" alt="ClientUI Data Framework &amp; QueryDescriptor" style="float:right; margin:0 0 10px 10px;" /><p>A while back, I <a href="http://intersoftpt.wordpress.com/2010/11/12/the-next-clientui-roadmap-unveiled/">posted</a> a blog that describes our plan to release a new Grid control to join our flagship ClientUI suite. One of the key goals of the new Grid control is to provide a full MVVM-ready data grid implementation that supports our long-term vision in cross-platform lineups, particularly for the Silverlight and WPF platforms. </p>
<p>The new Grid control, named UXGridView, will also be “LoB centric”, which means many of its features will be focused on line-of-business scenarios and usage, such as support for server paging and filtering through loosely-coupled MVVM pattern and data providers, grouping and totaling, and data exporting to name a few.</p>
<p>In this first series of the UXGridView blogs, I’m excited to introduce the first public preview of our most anticipated data controls. The first CTP release includes UXGridView, UXDataPager and UXDataFilter. Both Silverlight and WPF versions are available. Let’s see what they have to offer.</p>
<h2>MVVM &amp; Data Service Made Easy</h2>
<p>Data access in Silverlight and WPF has always been a challenging task, particularly when it comes to a combination of server-based operations like server filtering and paging. Put it together with another two design goals, MVVM pattern and unified cross-platform API, you will be surprised no one had ever addressed this elegantly, yet. As the matter of fact, I’ve tried to goggle this myself for a few hours without any luck.</p>
<p>Simplifying data access with our UI lineups has always been the utmost priority and motivation in our products engineering. This is reflected in our new data control lineups – the UXGridView, UXDataPager and UXDataFilter – which targeted to run in both Silverlight and WPF platforms; including support for server operations without coupled to any data access strategy.</p>
<p>UXGridView makes MVVM-compliant server operations possible through QueryDescriptor, a simple CLR object that developers can consume in their ViewModel classes. The QueryDescriptor contains information about the query which are two-way bound to the View components such as data grid, pager and filter. The descriptor is then parsed to the data provider, resulting the data shape to be processed further in the ViewModel. The interesting part here is that the View doesn’t know the existence of the descriptor, nor the other way around. And more importantly, the descriptor is not coupled to any data access strategy, which means you can parse it yourself in the way that meaningful to you, or let our extensions did it for you. More on that soon.</p>
<p>Let’s take a look at the following illustration for a big picture on the architectural design around the QueryDescriptor, MVVM and the data controls.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/02/querydescriptor.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="ClientUI Data Framework &amp; QueryDescriptor" border="0" alt="ClientUI Data Framework &amp; QueryDescriptor" src="http://intersoftpt.files.wordpress.com/2011/02/querydescriptor_thumb.png" width="642" height="466" /></a></p>
<p>As seen in the above illustration, the ViewModel does all the works, from parsing the descriptor, perform the query asynchronously, to setting the result into the collection property. The View simply accepts whatever data the ViewModel provided through two-way binding, and is completely agnostic to the operations or objects used in the ViewModel.</p>
<p>It’s important to note that the QueryDescriptor and its related classes are implemented in a lightweight assembly called Intersoft.Client.Data.ComponentModel, makes it ideal for use within your Model or ViewModel. This assembly contains only simple CLR objects – strictly no View/UI stuff.</p>
<p>In the high level implementation, the data view controls are declared in the following XAML example.</p>
<p>  </p><pre class="crayon-plain-tag">&lt;Intersoft:UXGridView QueryOperation=&quot;Server&quot;
                      IsBusy=&quot;{Binding IsBusy}&quot;
                      ItemsSource=&quot;{Binding Products}&quot; 
                      <strong>SortDescriptors=&quot;{Binding QueryDescriptor.
                               SortDescriptors, Mode=TwoWay}&quot;</strong>/&gt;

&lt;Intersoft:UXDataFilter ItemsSource=&quot;{Binding Categories}&quot;
                        QueryOperation=&quot;Server&quot;
                        <strong>FilterDescriptors=&quot;{Binding QueryDescriptor.
                                FilterDescriptors, Mode=TwoWay}&quot;</strong>/&gt;

&lt;Intersoft:UXDataPager PageSize=&quot;20&quot; QueryOperation=&quot;Server&quot;
                       <strong>PageDescriptor=&quot;{Binding QueryDescriptor.
                                PageDescriptor}&quot;</strong>/&gt;</pre><p></p>
<p>Next, you create a new instance of the QueryDescriptor in the ViewModel. The descriptor is a simple CLR property that is no difference with other properties in the ViewModel, such as shown below. </p>
<p></p><pre class="crayon-plain-tag">private QueryDescriptor _queryDescriptor;

public QueryDescriptor QueryDescriptor
{
    get
    {
        return this._queryDescriptor;
    }
    set
    {
        if (this._queryDescriptor != value)
        {
            if (this._queryDescriptor != null)
                this._queryDescriptor.QueryChanged -= 
                   new System.EventHandler(OnQueryChanged);

            this._queryDescriptor = value;
            this._queryDescriptor.QueryChanged += 
                new System.EventHandler(OnQueryChanged);

            this.OnPropertyChanged(&quot;QueryDescriptor&quot;);
        }
    }
}

public DefaultViewModel()
{
      <strong>this.QueryDescriptor = new QueryDescriptor();</strong>
}</pre><p></p>
<p>Clearly, any changes that users made at runtime, such as sorting on the UXGridView, navigating to certain page on the UXDataPager, or applying filter on the UXDataFilter; automatically raises the QueryChanged event of the descriptor. Since the descriptor contains all information about the requested query, it allows you to centralize all data operations in a single entry point in your ViewModel, such as shown below.</p>
<p></p><pre class="crayon-plain-tag">private void OnQueryChanged(object sender, EventArgs e)
{
      this.LoadProducts();
}</pre><p></p>
<p>Hopefully I have shown it clear to you how easy it is to create a high-performance data grid with server filtering and server paging. And with MVVM pattern, it allows you to consistently apply the same technique to the rest of grids in your applications.</p>
<h2>Intersoft Data Extension for DevForce 6.0.8</h2>
<p>For DevForce’s users, get ready to query your data in a whole new light! In this first CTP release, we’re excited to ship the data provider extension that makes it extremely easy to query data using DevForce 6.0.8. The data provider extension takes the QueryDescriptor as an input, parses it, and automatically translates it into something that DevForce understood.</p>
<p>This means that all server-based data operations, such as sorting, filtering and paging, are taken care in a single syntax, see the following code.</p>
<p></p><pre class="crayon-plain-tag">public virtual void LoadProducts()
{
    this.IsBusy = true;

    this.ProductsSource.GetData
    (
        <strong>this.QueryDescriptor</strong>,

        (products) =&gt;
        {
            this.Products = new PagedCollectionView(products);
            this.IsBusy = false;
        },
        (error) =&gt;
        {
	    // handle error
        }
    );
}</pre><p></p>
<p>Again, remember that the data extension is not coupled to the descriptor nor the data controls. It’s implemented in a separate lightweight assembly that establishes a reference to both Intersoft.Client.Data.ComponentModel and DevForce assemblies.</p>
<p><strong>Update 2/15/2010</strong>: Our friend, Bill Gower, posted a series of great tutorials explaining how to use QueryDescriptor and UXGridView in real-world scenarios. Check out his thought on UXGridView <a href="http://billgower.wordpress.com/2011/02/10/first-thoughts-on-the-new-intersoft-uxgridview/" target="_blank">here</a>, the basics of QueryDescriptor <a href="http://billgower.wordpress.com/2011/02/11/goodbye-predicatebuilder-hello-querydescriptor/" target="_blank">here</a>, and how to configure multiple FilterDescriptors <a href="http://billgower.wordpress.com/2011/02/13/enhancing-our-members-listing/" target="_blank">here</a>.</p>
<h2>Download the CTP1 Bits</h2>
<p>The first CTP bits released today includes a handful of samples that you can play around to test drive the core Grid features. The sample project comes with a simple navigation interface, built entirely with ClientUI’s navigation framework, shown below.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/02/image.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="UXGridView Samples" border="0" alt="UXGridView Samples" src="http://intersoftpt.files.wordpress.com/2011/02/image_thumb.png" width="607" height="482" /></a></p>
<p>Click <a href="http://www.intersoftpt.com/ClientUI/Intersoft.ClientUI.Data.Samples.zip">here</a> to download the CTP1 bits of the new data controls. This single download includes a number of solutions tailored for different platforms and different data access provider. The download contains the following:</p>
<ul>
<li>Latest ClientUI assemblies (Framework, Aqua, Interactivity) </li>
<li>ClientUI Data CTP1 assemblies (Silverlight and WPF) </li>
<li>Sample solution using WCF RIA Services (Silverlight) </li>
<li>Sample solution using DevForce 6.0.8 (Silverlight and WPF) </li>
</ul>
<p>All solutions share the same XAML file despite the differences in platforms and data access technologies – another interesting sample project to learn about MVVM and unified development model, see the following screenshot.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/02/image1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Solution files" border="0" alt="Solution files" src="http://intersoftpt.files.wordpress.com/2011/02/image_thumb1.png" width="642" height="212" /></a></p>
<p>We’d love to hear what you think about our new data controls. Be sure to send your thoughts to <a href="mailto:feedback@intersoftpt.com">feedback@intersoftpt.com</a>. And before you asked for a feature, please check out the CTP milestones in the last section below.</p>
<p><strong>IMPORTANT</strong>: You are required to install ClientUI in your development machine to develop and run the sample solutions. Click <a href="http://www.clientui.com/download">here</a> to download the ClientUI free trial. The latest DevForce (6.0.8) is required to run the DevForce samples, which can be obtained <a href="http://www.ideablade.com/DevForceUniversal/DevForceUniversal_DownloadEditions.aspx">here</a>.</p>
<h2>CTP Milestones</h2>
<p>Last but not least, I’d like to share about our release plans with you. Instead of releasing huge feature-sets in fairly longer timespan, we’ve chosen to release the UXGridView bits in more iterations with shorter timespan, focusing on each core feature-set at a time. This also allows our valued customers and partners to get an early preview, and send feedback while the product is being baked.</p>
<p>The UXGridView will be released in three CTPs before it reaches its RTM release scheduled on March this year. See the following chart for the milestone details.</p>
<p><a href="http://intersoftpt.files.wordpress.com/2011/02/image2.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="UXGridView Milestones" border="0" alt="UXGridView Milestones" src="http://intersoftpt.files.wordpress.com/2011/02/image_thumb2.png" width="642" height="481" /></a></p>
<p>In summary, the first CTP release is highly focused on the following feature sets:</p>
<ul>
<li>Core UXGridView infrastructure, including MVVM-ready design. </li>
<li>Core UXGridView features:
<ul>
<li>Layout features, such as dynamic row height, column freezing. </li>
<li>Interaction features, such as column resizing, reordering, fluid drag-drop. </li>
<li>Data features like group totals and aggregates. </li>
<li>UI features, such as status bar, commands, busy management. </li>
<li>Performance features, allows you to display millions of rows without lagging. </li>
</ul>
</li>
<li>Core data infrastructure, supporting both client-side and server-side query operation. </li>
<li>Core platform infrastructure, supporting both Silverlight and WPF. </li>
<li>Data component model, including QueryDescriptor and related data model. </li>
<li>Data providers:
<ul>
<li>For WCF RIA Services (Silverlight only, RIA did not support WPF) </li>
<li>For DevForce (Silverlight and WPF) </li>
</ul>
</li>
<li>UXDataPager with MVVM-ready architecture leveraging commands, visual state and multi-binding for loosely-coupled UI engineering. This allows you to completely customize the pager user interface without affecting the behaviors. </li>
<li>UXDataFilter with binding and core features, more UI stuff to come. </li>
</ul>
<p>Enjoy the CTP bits, and stay tuned for more exciting details!</p>
<p>PS: UXGridView is fully supported starting from this CTP release. Please post your questions or issues to our <a href="http://www.intersoftpt.com/Community/ClientUI">community forum</a>.</p>
<p>All the best,<br />
  <br />Jimmy Petrus </p>
<p>Chief Software Architect</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intersoftsolutions.com/2011/02/introducing-uxgridview-the-mvvm-ready-grid-for-silverlight-and-wpf/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
