Collapse Node


Can you show in the Entity Relationship example how to collapse and expand the Entity Node. Collapse would only show the header and expand would show complete node.


Just add a Button that toggles the visibility of everything but the header.

Or use an Expander, which isn’t a part of the standard run-time, nor of the standard SDK, but should be available in the Toolkit available on CodePlex. (If I recall correctly…)


When I get the button event, how do I get to the DataGrid properties?

Just to test what would happen if I changed the DataGrid’s Visibility property I added the following event.

private void DataGrid_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
DataGrid grid = (DataGrid)sender;
grid.Visibility = Visibility.Collapsed;


This did exactly what i need.

How do I accomplish the same result from the button event?


If you x:Name the grid in the template, you can find it by name by calling Part.FindNamedDescendant.

Or you could call Part.FindDescendant(e => e is DataGrid) as DataGrid.

Hi Walter,

I used the x:name way. I just wanted to let you know that Part.FindDescendant and Part.FindNamedDescendant did not show in <div =“s hc”>IntelliSense.

Thanks for all your help