/// <summary> /// Opens the search data dialog /// </summary> public void SearchData() { bool isLeft = grdLeft.Focused; SQLiteCreateTableStatement table = isLeft ? (SQLiteCreateTableStatement)_item.LeftDdlStatement : (SQLiteCreateTableStatement)_item.RightDdlStatement; FastGrid grid = isLeft ? grdLeft : grdRight; FastGridLocation loc = grid.SelectedCellLocation; FastGridColumn fcol = grid.Columns[loc.ColumnIndex]; string cname = (string)fcol.Tag; _searchDialog.PrepareDialog(table.Columns, cname, _diff, _tableChanges, loc.RowIndex + 1, isLeft); DialogResult res = _searchDialog.ShowDialog(this); if (res == DialogResult.OK && _searchDialog.MatchedRowIndex != -1) { FastGridSelection sel = new FastGridSelection(); sel.AddSelection(_searchDialog.MatchedRowIndex, _searchDialog.MatchedRowIndex); FastGridLocation nloc = new FastGridLocation(_searchDialog.MatchedRowIndex, loc.ColumnIndex); grdLeft.SelectedCellLocation = nloc; grdLeft.Selection = sel; grdRight.SelectedCellLocation = nloc; grdRight.Selection = (FastGridSelection)sel.Clone(); } }
/// <summary> /// Sets the data source for painting the selection portion /// </summary> /// <param name="max">The maximum row id</param> /// <param name="selection">The selection ranges to paint</param> public void SetData(long max, FastGridSelection selection) { _max = max; _selection = selection; Invalidate(); }