protected void OnTvUsuariosCursorChanged(object sender, EventArgs e) { TreeSelection seleccion = (sender as TreeView).Selection; TreeIter iter; TreeModel model; if (seleccion.GetSelected(out model, out iter)) { u = dtu.listarUsuarioById(Convert.ToInt32(model.GetValue(iter, 0))); Console.WriteLine(u); this.txtID.Text = u.Idusuario.ToString(); this.txtUsuario.Text = u.NombreUsuario.ToString(); } }