public override bool SetCurrentCell(DataGridCell cell, bool shift, bool ctrl) { if (cell != null) { C1DataGrid dataGrid = cell.DataGrid; dataGrid.CurrentCell = cell; dataGrid.Selection.BeginUpdate(); dataGrid.Selection.Clear(); dataGrid.Selection.Add(cell, cell); dataGrid.Selection.EndUpdate(); while (true) { if (cell.DataGrid == dataGrid) { dataGrid.ScrollIntoView(); } else { dataGrid.ScrollIntoView(cell.Presenter); } var row = GetParentRow(dataGrid); if (row != null) { dataGrid = row.DataGrid; } else { break; } } return(true); } return(false); }
public void Select(int start, int length) { // keep track of selection within the cell _selStart = start; _selLength = length; // check that the cell being checked is selected _grid.SelectedIndex = _row; _grid.CurrentColumn = _cols[_col]; _grid.ScrollIntoView(_grid.SelectedItem, _grid.CurrentColumn); }