I have a grid with 2 subgrids. This hierachy is defined in the xaml with the ChildTableDefinitions property. The child grids have
in order to avoid a clutter of scrollbars. Also row virtualization has been turned off for as well the main grid as the child grids.
Now I'm implementing a refresh operation. During this, I want to reselect the item that was selected before the refresh was started (there is only one item selected in all these grids). I do this by expanding the appropriate rows until I reach the grid with the item to be selected. Then I set that grid's SelectedItem property.
So far so good. Well... For obvious reasons I want to scroll the selected item back into view. When the selected row was in the main grid, I can just perform a
with objSel being a refreshed object. But when I do this for a childgrid, nothing happens. I presume because the child grid doesn't have a scrollbar and as far as this grid is concerned, the selected row is in view.
Also when I try
nothing happens. I guess because objSel is not in the ItemsSource of the main grid (I didn't expect it to work, but I had to try). Also
did not work out.
So I wonder what is a correct approach to scroll the selected item of a childgrid into view.
Thanks in advance,
Herre
grd.MaxHeight =
double
.PositiveInfinity;
Now I'm implementing a refresh operation. During this, I want to reselect the item that was selected before the refresh was started (there is only one item selected in all these grids). I do this by expanding the appropriate rows until I reach the grid with the item to be selected. Then I set that grid's SelectedItem property.
So far so good. Well... For obvious reasons I want to scroll the selected item back into view. When the selected row was in the main grid, I can just perform a
grd.ScrollIntoView(objSel);
Also when I try
grdMain.ScrollIntoView(objSel);
grd.BringIntoView();
So I wonder what is a correct approach to scroll the selected item of a childgrid into view.
Thanks in advance,
Herre