Any way to ensure a selected Datagrid row is visble?
-
I have a form with two DataGrid controls. When a user selects a row in DataGrid1, DataGrid2 is populated with child data using a filtered DataView object. I also have certain criteria that allows me to preselect a "default" row of data in DataGrid2. So basically user clicks on a row in DataGrid1, DataGrid2 is populated with all valid child data, and then the program also automatically selects a row in DataGrid2 that in most cases will be the correct selection. But the user also has the choice to change the selection in DataGrid2 before continuing. The code works fine - the CurrentCellChanged event in DataGrid1 correctly populates all rows into DataGrid2 and then additional code correctly "pre-selects" a default row in DataGrid2. In most cases the user will simply accept the default selection in DataGrid2, but they still need to be able to review the programmatic default selection before they accept it. The problem is I can preselect a default row in DataGrid2, but that selection may not always be within the rows that are visible in DataGrid2. What I want to do is ensure that the preselected (programmatically selected) default row in DataGrid2 is always visible without the user actually having to scroll down to find the preselected row. Is this possible??? TIA!!!!