Exemple #1
0
        private ElementoListaDTO ObtenerElementoSeleccionado()
        {
            ElementoListaDTO elementoLista          = null;
            DataGridViewSelectedRowCollection filas = lstResultado.SelectedRows;

            if (filas.Count > 0)
            {
                elementoLista = new ElementoListaDTO();
                foreach (DataGridViewRow fila in filas)
                {
                    elementoLista.Id   = (long)fila.Cells[0].Value;
                    elementoLista.Tipo = (string)fila.Cells[2].Value;
                    break;
                }
            }

            return(elementoLista);
        }
Exemple #2
0
        private void cmdEditar_Click(object sender, EventArgs e)
        {
            ElementoListaDTO elemento = ObtenerElementoSeleccionado();

            EditarElementoLista(elemento.Tipo, elemento.Id);
        }