iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
Story: 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.
Additional Requirements: 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.
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.
Question: 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?
Thanks,
Cyle
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?
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.
Okay, thanks for checking on that for me.
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 ;-)
DataContextProxy - 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.
http://weblogs.asp.net/dwahlin/archive/2009/08/20/creating-a-silverlight-datacontext-proxy-to-simplify-data-binding-in-nested-controls.aspx
DataTemplateSelector - For defining the different cell templates (under DataPresenterTextColumn.CellTemplate).
http://www.codeproject.com/KB/silverlight/SLTemplateSelector.aspx
Behaviors - 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.
http://www.silverlightshow.net/items/Behaviors-and-Triggers-in-Silverlight-3.aspx
Cheers,
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname