private void sortToolStripButton_Click(object sender, EventArgs e) { if (!CanContinue()) { return; } using (SortDialog sortDialog = new SortDialog(this.sort)) { FormExtensions.DownPositionate(sortDialog, sortToolStripButton, this); if (sortDialog.ShowDialog(this) == DialogResult.OK) { TableSort lastGood = this.sort; this.sort = sortDialog.Sort; this.sortToolStripButton.Checked = IsSorted; this.sortToolStripButton.ToolTipText = IsSorted ? sort.ToString() : "Sort"; try { UpdateDataSet(); } catch (Exception ex) { MessageBox.Show(this, ex.Message, this.Text, MessageBoxButtons.OK); this.sort = lastGood; UpdateDataSet(); } } else { if (this.refreshDataNeeded) { this.UpdateDataSet(); } } } }
private void rowsPerPageButton_Click(object sender, EventArgs e) { if (!CanContinue()) { return; } using (RowsPerPageDialog dialog = new RowsPerPageDialog()) { dialog.RowsPerPage = rowsPerPage; FormExtensions.DownPositionate(dialog, rowsPerPageButton, this); if (dialog.ShowDialog(this) == DialogResult.OK) { if (rowsPerPage != dialog.RowsPerPage) { rowsPerPage = dialog.RowsPerPage; rowsPerPageButton.Text = rowsPerPage.ToString(); this.UpdateDataSet(); } } else { if (this.refreshDataNeeded) { this.UpdateDataSet(); } } } }
public DbProvider SelectProvider() { DbProvider provider = null; using (SelectProviderDialog providerDialog = new SelectProviderDialog()) { FormExtensions.DownPositionate(providerDialog, this.toolStrip); if (providerDialog.ShowDialog(this) == DialogResult.OK) { provider = providerDialog.Provider; } } return(provider); }
private void filterToolStripButton_Click(object sender, EventArgs e) { if (!CanContinue()) { return; } using (FilterDialog filterDialog = new FilterDialog(this.filter.Clone())) { FormExtensions.DownPositionate(filterDialog, filterToolStripButton, this); if (filterDialog.ShowDialog(this) == DialogResult.OK) { TableFilter lastGood = this.filter; this.filter = filterDialog.Filter; if (IsFiltered) { this.currentPage = 0; this.filterToolStripButton.Checked = true; } else { this.filterToolStripButton.Checked = false; } this.filterToolStripButton.ToolTipText = IsFiltered ? filter.ToString() : "Filter"; try { this.UpdateDataSet(); } catch (Exception ex) { this.filter = lastGood; MessageBox.Show(this, ex.Message, this.Text, MessageBoxButtons.OK); this.UpdateDataSet(); } } else { if (this.refreshDataNeeded) { this.UpdateDataSet(); } } } }
private void Replace(object sender, EventArgs e) { FormExtensions.DownPositionate(this.findDialog, this.findToolStripButton, this); this.findDialog.ShowFor(this.textEditorControl, true); }