/// <summary> /// Shows Selected tests or all the tests based on the link text /// </summary> /// <param name="selected">shows selected tests if true, else shows all tests</param> private void ShowTests(bool selected) { //Removes the filter DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(testCaseDetails_DataGrid); // Since the control is bound to a dataset, suspend the binding on all the rows in the currency manager before setting them to invisible: CurrencyManager bindingCurrencyManager = (CurrencyManager)BindingContext[testCaseDetails_DataGrid.DataSource]; if (selected) { foreach (DataGridViewRow row in testCaseDetails_DataGrid.Rows) { if ((bool)row.Cells[0].Value == true) { row.Visible = true; } else { //Suspend the databinding bindingCurrencyManager.SuspendBinding(); row.Visible = false; } } } else { foreach (DataGridViewRow row in testCaseDetails_DataGrid.Rows) { row.Visible = true; } } //Resume the databinding bindingCurrencyManager.ResumeBinding(); }
private void lnkClearFilter_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(dgvReport); bsShipmentData.DataSource = ShipmentData; dgvReport.DataSource = bsShipmentData; } catch (Exception ex) { ErrorHandling.WriteErrorLog(ex.ToString()); } }
private void bdnInfo_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { if (pageCount > 1) { if (e.ClickedItem.Text == "上一页") { pageCurrent--; if (pageCurrent <= 0) { pageCurrent++; return; } else { DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(gv_taskmanager); BindData(0); } } if (e.ClickedItem.Text == "下一页") { pageCurrent++; if (pageCurrent > pageCount) { pageCurrent--; return; } else { DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(gv_taskmanager); BindData(0); } } if (e.ClickedItem.Text == "首页") { pageCurrent = 1; DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(gv_taskmanager); BindData(0); } if (e.ClickedItem.Text == "末页") { pageCurrent = pageCount; DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(gv_taskmanager); BindData(0); } } if (e.ClickedItem.Text == "刷新") { DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(gv_taskmanager); BindData(1); } }
/// <summary> /// Clears all the filters and selections on the tests /// </summary> /// <param name="sender">sender</param> /// <param name="e">event args</param> private void clearAll_LinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { //Removes the filter DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(testCaseDetails_DataGrid); selectAll_CheckBox.CheckState = CheckState.Unchecked; if (showSelected_LinkLabel.Text == "Show All") { ShowTests(false); } ChangeSelection(false); moveButtons_Panel.Enabled = true; }
private void lnklblAll_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { lnklblAll.Visible = false; DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(dgvDeliveryDetails); bsDeliveryDetails.DataSource = dtDeliveryDetails; dgvDeliveryDetails.DataSource = bsDeliveryDetails; } catch (Exception ex) { ErrorHandling.WriteErrorLog(ex.ToString()); } }
/// <summary> /// Clear filter on data grid view - shows all records. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void lnklblClearFilter_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { // lnklblClearFilter.Visible = false; DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(dgvTasks); //bsTansList.DataSource = ShipmentTANs; //dgvShipmentTANs.DataSource = bsTansList; if (HeaderCheckBox.Checked) { HeaderCheckBox.Checked = false; } } catch (Exception ex) { ErrorHandling.WriteErrorLog(ex.ToString()); } }
// Clears the filter when the user clicks the "Show All" link // or presses ALT+A. private void showAllLabel_Click(object sender, EventArgs e) { DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(dataGridView1); }
/// <summary> /// Removes the filter from the BindingSource bound to the specified DataGridView. /// </summary> /// <param name="dataGridView">The DataGridView bound to the BindingSource to unfilter.</param> public static void RemoveFilter(DataGridView dataGridView) { DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(dataGridView); }
private void toolStripStatus_ShowAll_Click(object sender, EventArgs e) { DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(this.dataGridView1); }
private void toolStripButton6_Click(object sender, EventArgs e) { DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(gv_taskmanager); }
private void tsbRemoveFilter_Click(object sender, EventArgs e) { DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(dgvUserProjectGroups); }
void remclick(object sender, EventArgs e) { DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(dgv); }
private void lnkShowAllConfiguration_Click(object sender, EventArgs e) { DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(dgvConfiguration); }
private void lnkShowAllSource_Click(object sender, EventArgs e) { DataGridViewAutoFilterColumnHeaderCell.RemoveFilter(dgvSource); }