We have a control that has a WindowContainer. Inside this window container, we dynamically add a ChildWindow within it.
```
private void Window_Loaded(object sender, RoutedEventArgs e)
{
ChildWindow childWindow = new ChildWindow();
childWindow.Content = new StudentsList();
MyContainer.Children.Add(childWindow);
childWindow.Show();
}
```
Our child window contains a DataGrid. Everything works as expected when the DataGrid has no vertical scroll bar. However, when the vertical scroll bar is visible, we find that the down arrow button on the scroll bar would not work. We can see that the scroll bar button is in focus and highlighted when the mouse hovers over it, but we cannot click on it. We also noticed through our debugging that if we have multiple DataGrids, all the scroll bars work except for the very last DataGrid.
To make things more interesting, when we disable all the windows visual effects (My Computer > Properties > Advanced Settings > Advanced > Performance > Settings > Visual Effects > Adjust for best performance), all the buttons below the affected scroll bar cannot be clicked by the mouse. They are clickable when we set visual effects to "Adjust for best appearance" however.
If we take the WindowContainer out of the equation by adding the ChildWindow to the Grid control directly, it seems to work fine.
```
private void Window_Loaded(object sender, RoutedEventArgs e)
{
ChildWindow childWindow = new ChildWindow();
childWindow.Content = new StudentsList();
MyContainer.Children.Add(childWindow);
childWindow.Show();
}
```
Our child window contains a DataGrid. Everything works as expected when the DataGrid has no vertical scroll bar. However, when the vertical scroll bar is visible, we find that the down arrow button on the scroll bar would not work. We can see that the scroll bar button is in focus and highlighted when the mouse hovers over it, but we cannot click on it. We also noticed through our debugging that if we have multiple DataGrids, all the scroll bars work except for the very last DataGrid.
To make things more interesting, when we disable all the windows visual effects (My Computer > Properties > Advanced Settings > Advanced > Performance > Settings > Visual Effects > Adjust for best performance), all the buttons below the affected scroll bar cannot be clicked by the mouse. They are clickable when we set visual effects to "Adjust for best appearance" however.
If we take the WindowContainer out of the equation by adding the ChildWindow to the Grid control directly, it seems to work fine.