private void ChkAll_CheckedChanged(object sender, EventArgs e) { int n_row = 0; if (ChkAll.Checked == true) { for (n_row = 0; n_row <= FgFiltro.Rows.Count - 1; n_row++) { FgFiltro.SetData(n_row, FgFiltro.Cols.Count - 2, 1); } } }
void Aceptar() { int n_row = 0; DataTable dtResult = new DataTable(); string strCondicionFiltro = ""; string c_dato = ""; string c_tipdat = ""; Helper.Comunes.Funciones fun = new Helper.Comunes.Funciones(); int n_NumeroElementos = Convert.ToInt32(arrCabeceraFlex.GetLongLength(0)) - 1; dtResult = dtConsulta.Clone(); for (n_row = 0; n_row <= n_NumeroElementos; n_row++) { if (arrCabeceraFlex[n_row, 4] == c_campobusqueda) { c_tipdat = arrCabeceraFlex[n_row, 2]; } } for (n_row = 0; n_row <= FgFiltro.Rows.Count - 1; n_row++) { if (fun.NulosC(FgFiltro.GetData(n_row, n_columnacheck)) == "True") { c_dato = FgFiltro.GetData(n_row, n_columnabusqueda).ToString(); if (c_tipdat == "N") { strCondicionFiltro = "" + c_campobusqueda + " = " + c_dato + ""; } if (c_tipdat == "C") { strCondicionFiltro = "" + c_campobusqueda + " = '" + c_dato + "'"; } DataRow[] result = dtConsulta.Select(strCondicionFiltro); foreach (DataRow row in result) { dtResult.ImportRow(row); } } } dtResultado = dtResult; this.Hide(); }
private void FgFiltro_KeyUp(object sender, KeyEventArgs e) { if ((e.KeyCode.ToString() != "Insert") && (e.KeyCode.ToString() != "Delete")) { return; } if (e.KeyCode.ToString() == "Insert") { FgFiltro.SetData(FgFiltro.Row, n_colseleccion, true); } if (e.KeyCode.ToString() == "Delete") { FgFiltro.SetData(FgFiltro.Row, n_colseleccion, false); } }