﻿<?xml version="1.0" encoding="utf-8"?><rss 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:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - ClientUI - Binding GridPresenter to List&lt;...&gt; and UXComboBox within grid cells bound to different item source</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Binding-GridPresenter-to-List-and-UXComboBox-within-grid-cells-bound-to-different-item-source/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Binding GridPresenter to List&lt;...&gt; and UXComboBox within grid cells bound to different item source</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Binding-GridPresenter-to-List-and-UXComboBox-within-grid-cells-bound-to-different-item-source/</link><pubDate>Wed, 22 Sep 2010 06:36:38 GMT</pubDate><dc:creator>sipe16</dc:creator><category>GridPresenter Binding</category><description>&lt;p&gt;Okay, thanks for checking on that for me.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;In the mean-time, for anyone else who is interested in similar functionality, I've managed to get around this using a combination of the following concepts.  I have no idea if it was the best or most efficient way, but it works and doesn't seem to cause any performance issues ;-)&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;DataContextProxy&lt;/strong&gt; - For being able to access my ViewModel (as DataContext, which I only want to be instantiated once) from within a DataTemplate.  The problem you run into is not being able to access the DataContext by key.  This post offers a solution to that problem.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://weblogs.asp.net/dwahlin/archive/2009/08/20/creating-a-silverlight-datacontext-proxy-to-simplify-data-binding-in-nested-controls.aspx"&gt;http://weblogs.asp.net/dwahlin/archive/2009/08/20/creating-a-silverlight-datacontext-proxy-to-simplify-data-binding-in-nested-controls.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;DataTemplateSelector&lt;/strong&gt; - For defining the different cell templates (under DataPresenterTextColumn.CellTemplate).&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.codeproject.com/KB/silverlight/SLTemplateSelector.aspx"&gt;http://www.codeproject.com/KB/silverlight/SLTemplateSelector.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Behaviors&lt;/strong&gt; - Allows you to capture events from UIElements (e.g. elements within the Cell, f.ex. your DataTemplateSelector implementation).  You can, for example, switch the ContentTemplate of the DataTemplateSelector when a MouseLeftButtonDown event occurs.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.silverlightshow.net/items/Behaviors-and-Triggers-in-Silverlight-3.aspx"&gt;http://www.silverlightshow.net/items/Behaviors-and-Triggers-in-Silverlight-3.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Cyle&lt;/p&gt;</description></item><item><title>Binding GridPresenter to List&lt;...&gt; and UXComboBox within grid cells bound to different item source</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Binding-GridPresenter-to-List-and-UXComboBox-within-grid-cells-bound-to-different-item-source/</link><pubDate>Sun, 19 Sep 2010 23:34:05 GMT</pubDate><dc:creator>Glayaar</dc:creator><category>GridPresenter Binding</category><description>&lt;p&gt;Based on my discussion with the developer, seperate cell /row edit mode and display mode feature has not been supported in GridPresenter. The feature is being considered for GridPresenter, however I do not have a fixed timetable for the release of the feature.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Binding GridPresenter to List&lt;...&gt; and UXComboBox within grid cells bound to different item source</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Binding-GridPresenter-to-List-and-UXComboBox-within-grid-cells-bound-to-different-item-source/</link><pubDate>Sun, 19 Sep 2010 14:33:48 GMT</pubDate><dc:creator>sipe16</dc:creator><category>GridPresenter Binding</category><description>&lt;p&gt;I've actually done some more playing around with this and it seems to work quite well with GridPresenter and UXComboBox.  However, I'm not seeing a way to define a separate template for edit-mode vs. display mode.  Is there a way to set a ContentSelector on the DataPresenterTextColumn, or is there a different way to go about this?  Only other thing I can think of would be to use a UXItemsControl and set the ItemTemplateSelector there?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Cyle&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>Binding GridPresenter to List&lt;...&gt; and UXComboBox within grid cells bound to different item source</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Binding-GridPresenter-to-List-and-UXComboBox-within-grid-cells-bound-to-different-item-source/</link><pubDate>Sat, 18 Sep 2010 10:24:14 GMT</pubDate><dc:creator>sipe16</dc:creator><category>GridPresenter Binding</category><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Story:&lt;/strong&gt; I'm trying to create a little UI where a user can define comparison rules.  I want there to be three columns: Left, Operator and Right.  For "Left" and "Operator" there are fixed enumerations (exposed as properties on the ViewModel) that the user can select from, which I want to be done via an inline drop-down list in the column.  The contents of "Right" will differ based on the combination of selections of "Left" and "Operator" (not worried about that now).  I would also like all columns to only display text (instead of combo boxes) when not in edit mode.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Additional Requirements:&lt;/strong&gt; The grid is mapped to an observable list of complex objects; e.g. the combo box items are objects of type MyObj which should be populated from a fixed enumeration from the ViewModel.  The combo box selected values should be bound to the corresponding property of type MyObj on the complex object represented in the row. &lt;/p&gt;
&lt;p&gt;The reason that I've chosen to begin with the GridPresenter is I want to take advantage of the "AllowAddNew" functionality instead of writing custom logic to deal with CRUD operations on the comparison rules list.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; What is the best way to go about this using the controls contained within the ClientUI suite?  Should I be using a ComboBox?  Is this possible with GridPresenter?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Cyle&lt;/p&gt;</description></item></channel></rss>