public void consultarCategoria() { try { int grupo = 0; if (UIGRIDVIEWGRUPO.FocusedRowHandle >= 0) { try { grupo = (int)(UIGRIDVIEWGRUPO.GetFocusedRowCellValue("ID")); } catch (Exception) { } } // lista_categoria = new System.ComponentModel.BindingList<INV_CATEGORIA >((from u in _datasistema.ContextoInventario.INV_CATEGORIA where u.ID_EMPRESA == _datasistema.empresa.ID && u.ID_GRUPO == grupo select u // ).ToList()); lista_categoria = new System.ComponentModel.BindingList <INV_CATEGORIA>(manejadorCategoria.consultarPorIdEmpresaPorGrupo(_datasistema.empresa.ID, grupo)); lista_categoria.AddingNew += list_AddinCategoria; UIGRIDCONTROLCATEGORIA.DataSource = lista_categoria; } catch (Exception ex) { MetodosForm.mensajeErrorDefault(ex.Message, _datasistema); } }
private void UIGRIDVIEWCATEGORIA_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e) { UIGRIDVIEWCATEGORIA.SetFocusedRowCellValue("ID", 0); UIGRIDVIEWCATEGORIA.SetFocusedRowCellValue("ID_EMPRESA", _datasistema.empresa.ID); int grupo = 0; if (UIGRIDVIEWGRUPO.FocusedRowHandle >= 0) { grupo = (int)(UIGRIDVIEWGRUPO.GetFocusedRowCellValue("ID")); } UIGRIDVIEWCATEGORIA.SetFocusedRowCellValue("ID_GRUPO", grupo); }
private void UIGRIDVIEWGRUPO_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e) { UIGRIDVIEWGRUPO.SetFocusedRowCellValue("ID", 0); UIGRIDVIEWGRUPO.SetFocusedRowCellValue("ID_EMPRESA", _datasistema.empresa.ID); int fam = 0; if (UIGRIDVIEWFAMILIA.FocusedRowHandle >= 0) { fam = (int)(UIGRIDVIEWFAMILIA.GetFocusedRowCellValue("ID")); } UIGRIDVIEWGRUPO.SetFocusedRowCellValue("ID_FAMILIA", fam); }
private void UIGRIDVIEWGRUPO_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete && UIGRIDVIEWGRUPO.FocusedRowHandle >= 0) { if (MetodosForm.preguntar(3)) { INV_GRUPO d = new INV_GRUPO() { ID = (int)UIGRIDVIEWGRUPO.GetFocusedRowCellValue("ID") }; eliminargrupo(d); } } }