In order to achieve your goal, you can use GridView's GetRowForItem method and the DetailsVisibility property of GridViewRow. Please check the following code snippet for a reference:
public override IEnumerable<
> ProvideCommandsForKey(Key key)
> commandsToExecute = base.ProvideCommandsForKey(key).ToList();
if (key == Key.Space)
var itemToExpand = this.parentGrid.GetRowForItem(this.parentGrid.SelectedItem);
if (itemToExpand != null)
itemToExpand.DetailsVisibility = itemToExpand.DetailsVisibility.GetValueOrDefault(Visibility.Collapsed) == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
Please give it a try and let me know how it works for you.
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos
and start improving your app based on facts, not hunches.