private void RefreshUi() { dgwTests.DataSource = db.GetTests(); txtIdTest.Text = currentTest.IdTest.ToString(); txtTestName.Text = currentTest.Name; txtTestDescription.Text = currentTest.Desc; if (currentTest.IdTest != 0) { dgwQuestions.DataSource = db.GetAllQuestionsOfATest(currentTest.IdTest); } // !!!! put the rest of the data !!!! }