![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Select hidden treeviewitem in databound treeview I'm having an issue selecting a databound treeview item in a treeview. If the treeview has not already been expanded, then the treeviewitems don't exist, so the code: TreeViewItem tvi = (TreeViewItem)(header.ItemContainerGenerator.ContainerFromItem(databoundobject)); returns null. If I do: header.IsExpanded = true; before the call, the UI isn't updated (and the items bound) until after my method returns, so I still get null (but the treeview is expended after my method returns). So, I tried using a WorkItem to expand on another thread: if(header.IsExpanded == false) { header.IsExpanded = true; //we have to queue a workitem since we have to wait for the header to expand System.Threading.ThreadPool.QueueUserWorkItem(ExpandedToSelectProcessWorkItemCallback, databoundobject); } However, then my callback throws a InvalidOperation exception because I'm accessing the treeview on another thread. So, I dug around and found people talking about the UIContext in this NG, but I can't find any mention of it in the Dec CTP. So, my question is: -What's the best way to expand the treeview before searching it? (Please don't say animations, please don't say animations.. )-Bonus Question: what's the equivalent of UIContext in the Dec CTP? |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Databound animation | Joao Paulo Duque Vieira | Avalon | 4 | 04-13-2008 11:28 AM |
| TreeView, TreeViewItem | knallkopf66 | Avalon | 1 | 08-16-2007 08:24 PM |
| How to get the Parent of a TreeViewItem in a treeview when using HierchicalDataTemplate ? | Pon | Avalon | 1 | 04-05-2007 03:16 AM |
| Databound treeview and selectedItem cast to Treeviewitem | cheesetarmac | Avalon | 2 | 11-14-2006 03:43 AM |
| Drag and Drop Treeview Items between 2 Treeview | ProjectGKR | Avalon | 3 | 03-14-2006 07:29 AM |