Seems to have done the trick. Hooked into the Loaded event on the TreeView just before setting the ItemsSource property. On Sat, Mar 28, 2009 at 6:05 PM, Stephen Price <[email protected]>wrote:
> Hmm, according to the docs that's for selecting what Field is returned when > you read SelectedValue. > I've gotten deeper into the issue and found that its a timing thing. When I > set the ItemsSource property to the data, and then try to select an item in > the TreeView, the data is there but the TreeView hasn't finished processing > it. So that means the .ItemContainerGenerator class returns nulls when I try > to get the TreeViewItem from the DataItem (using the ContainerFromItem > method). > > My code works fine if I select something from say a button event when the > TreeView has finished loading the data. I can't find an event yet that I can > use to indicate the data has loaded. (Unless maybe the Loaded event happens > again? It seems to trigger the Loaded event when the TreeView is rendered). > > cheers, > Stephen > > 2009/3/28 Jonathan Parker <[email protected]> > >> Just a guess but maybe you have to set the SelectedValuePath property. >> >> >> On Sat, Mar 28, 2009 at 2:17 AM, Stephen Price >> <[email protected]>wrote: >> >>> Has anyone had a good play with the Treeview control in the Silverlight >>> Toolkit? I can't seem to figure out how to easily deselect all nodes. >>> I tried looping through all nodes and setting IsSelected to false but it >>> didn't seem to work. >>> >>> thanks :) >>> >>> Stephen >>> ------------------------------ >>> Support procedure: https://www.codify.com/lists/support >>> List address: [email protected] >>> Subscribe: [email protected] >>> Unsubscribe: [email protected] >>> List FAQ: http://www.codify.com/lists/ozsilverlight >>> Other lists you might want to join: http://www.codify.com/lists >> >> >> ------------------------------ >> Support procedure: https://www.codify.com/lists/support >> List address: [email protected] >> Subscribe: [email protected] >> Unsubscribe: [email protected] >> List FAQ: http://www.codify.com/lists/ozsilverlight >> Other lists you might want to join: http://www.codify.com/lists >> > > ------------------------------ > Support procedure: https://www.codify.com/lists/support > List address: [email protected] > Subscribe: [email protected] > Unsubscribe: [email protected] > List FAQ: http://www.codify.com/lists/ozsilverlight > Other lists you might want to join: http://www.codify.com/lists > -------------------------------------------------------------------------------- Support procedure: https://www.codify.com/lists/support List address: [email protected] Subscribe: [email protected] Unsubscribe: [email protected] List FAQ: http://www.codify.com/lists/ozsilverlight Other lists you might want to join: http://www.codify.com/lists
