Hey all, I've noticed that if I have a style setup for a treeview, and a different one setup for the treeviewitem, it gets overridden once I put the item in the tree. Does anyone have suggestions for how to control the style of each treeviewitem individually while mantaining a default style that is applied to the whole treeview? Basically I want to make the text of my treeviewitem red depending on a data field in the item. Otherwise I want it to be black. Thanks
A:
DataTemplateSelector is not in Silverlight. Try below link
http://blog.timmykokke.com/archive/2009/09/28/datatemplateselector-in-silverlight.aspx
Ragunathan
2010-06-29 08:52:41
I'm not looking for how to change a data template, that part is fine. I need ot know how to change the style. Unforunately, I cannot simply add Setters because the Style.Setters collection says its read only. Does that mean you cannot change the style during runtime? Thanks
JGord
2010-06-29 16:52:31
I think this is nice article based on your need.http://www.tozon.info/blog/post/2009/03/15/Dynamic-Data-Forms-for-Silverlight-with-a-Data-Template-Selector-Control.aspx
Ragunathan
2010-06-30 04:26:03
Thanks, turns out it was TreeViewItem.Style CAN be set to an ItemContainerStyle if you use the objects as references.
JGord
2010-07-02 19:34:02
A:
Thanks, turns out it was TreeViewItem.Style CAN be set to an ItemContainerStyle if you use the objects as references.
JGord
2010-07-14 18:54:21