User Profile & Activity

Cyle Witruk Member

Oops! I noticed I accidently put in the title "When DisplayStatusBar=Yes' - can you please change that to DisplayStatusBar="No"?

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,

Cyle

Posted: September 22, 2010 6:20 AM

That did it :-)  Thanks!

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?

Thanks,

Cyle

 

Posted: September 18, 2010 7:31 AM

Sorry, I should have included that :)  It's a Silverlight 4 application.

Thanks,

Cyle

All times are GMT -5. The time now is 4:31 AM.
Previous Next