/// <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(); } }
private FastGridColumn MakeGridColumn(bool pkey, SQLiteColumnStatement col) { string cname = SQLiteParser.Utils.Chop(col.ObjectName.ToString()); FastGridColumn res = new FastGridColumn(cname); if (Utils.GetDbType(col.ColumnType) == DbType.Boolean) { res.ColumnType = FastGridColumnType.CheckBox; } if (pkey) { res.Image = imageList1.Images[0]; } res.Tag = cname; return(res); }