private void clearandhide() { formloading = true; clearfilercombos(); Descrip_txtbox.Hide(); Descrip_txtbox.Clear(); filteroem_txtbox.Hide(); filteroem_txtbox.Clear(); filteroemitem_txtbox.Hide(); filteroemitem_txtbox.Clear(); filter4.Hide(); filter4.Clear(); //dt.Clear(); table0.Clear(); table1.Clear(); table2.Clear(); table3.Clear(); table4.Clear(); dataTable.Clear(); table0.Dispose(); table1.Dispose(); table2.Dispose(); dt.Dispose(); table3.Dispose(); table4.Dispose(); dataTable.Dispose(); recordlabel.Text = ""; formloading = false; }
private void Descrip_txtbox_KeyDown(object sender, KeyEventArgs e) { DataView dv = table0.DefaultView; table0 = dv.ToTable(); if (e.KeyCode == Keys.Return) { string search2 = Descrip_txtbox.Text; try { search2 = search2.Replace("'", "''"); search2 = search2.Replace("[", "[[]"); var secondFilter = string.Format(fullsearch, search2); if (dv.RowFilter == null || dv.RowFilter.Length == 0) { dv.RowFilter = secondFilter; } else { dv.RowFilter += " AND " + secondFilter; } dataGridView.DataSource = dv; SearchStringPosition(Descrip_txtbox.Text); searchtext(Descrip_txtbox.Text); table1 = dv.ToTable(); dataGridView.Refresh(); } catch (Exception) { MessageBox.Show("Invalid Search Criteria Operator.", "SPM Connect"); Descrip_txtbox.Clear(); SendKeys.Send("~"); } if (Descrip_txtbox.Text.Length > 0) { filteroem_txtbox.Show(); SendKeys.Send("{TAB}"); } else { filteroem_txtbox.Hide(); filteroemitem_txtbox.Hide(); filter4.Hide(); } if (Descrip_txtbox.Visible == (false)) { filteroem_txtbox.Hide(); } e.Handled = true; e.SuppressKeyPress = true; } }
private void clearandhide() { Descrip_txtbox.Hide(); Descrip_txtbox.Clear(); filteroem_txtbox.Hide(); filteroem_txtbox.Clear(); filteroemitem_txtbox.Hide(); filteroemitem_txtbox.Clear(); filter4.Hide(); filter4.Clear(); table0.Clear(); table1.Clear(); table2.Clear(); table3.Clear(); }
private void Descrip_txtbox_KeyDown(object sender, KeyEventArgs e) { DataView dv = table0.DefaultView; table0 = dv.ToTable(); if (e.KeyCode == Keys.Return) { formloading = true; string search2 = Descrip_txtbox.Text; try { search2 = search2.Replace("'", "''"); search2 = search2.Replace("[", "[[]"); var secondFilter = string.Format(fullsearch, search2); if (string.IsNullOrEmpty(dv.RowFilter)) { dv.RowFilter = secondFilter; } else { dv.RowFilter += " AND " + secondFilter; } table1 = dv.ToTable(); dataGridView.DataSource = table1; SearchStringPosition(); searchtext(Descrip_txtbox.Text); dataGridView.Refresh(); recordlabel.Text = "Found " + table1.Rows.Count.ToString() + " Matching Items."; } catch (Exception) { MessageBox.Show("Invalid Search Criteria Operator.", "SPM Connect - Search2"); Descrip_txtbox.Clear(); SendKeys.Send("~"); } finally { } if (Descrip_txtbox.Text.Length > 0) { filteroem_txtbox.Show(); SendKeys.Send("{TAB}"); } else { filteroem_txtbox.Hide(); filteroemitem_txtbox.Hide(); filter4.Hide(); } if (!Descrip_txtbox.Visible) { filteroem_txtbox.Hide(); } e.Handled = true; e.SuppressKeyPress = true; formloading = false; } }