I suppose this works, but I think you can use gridHeaders.Children.Clear() instead.