コード例 #1
0
        void Editar_ClickBoton(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            int[] selRows = ((GridView)gridViewEmpleados.GridControl.MainView).GetSelectedRows();

            DataRowView selRow   = (DataRowView)(((GridView)gridViewEmpleados.GridControl.MainView).GetRow(selRows[0]));
            DataTable   empleado = NEmpleado.BuscarPorId(selRow["idempleado"].ToString());

            foreach (DataRow row in empleado.Rows)
            {
                this.txtId.Text               = row["idempleado"].ToString();
                this.txtCedula.Text           = row["ci_ruc"].ToString();
                this.txtNombres.Text          = row["nombres"].ToString();
                this.txtApellidos.Text        = row["apellidos"].ToString();
                this.cmbGenero.Text           = row["sexo"].ToString();
                this.cmdEstadoCivil.Text      = row["estado_civil"].ToString();
                this.dateFechaNacimiento.Text = row["fecha_nac"].ToString();
                this.txtTelefono.Text         = row["telefono"].ToString();
                this.memoDireccion.Text       = row["direccion"].ToString();
                //this.pctFoto.Image = row["foto"];
            }
        }