private void gridResult_SelectionChanged(object sender, EventArgs e)
 {
     try
     {
         if (gridResult.SelectedRows.Count > 0)
         {
             viewModel.selectedItem = (Factor)gridResult.SelectedRows[0].DataBoundItem;
             if (viewModel.selectedItem != null)
             {
                 List <CustomGridQuestion> customGridQuestions = new List <CustomGridQuestion>();
                 foreach (Question q in viewModel.selectedItem.questions)
                 {
                     customGridQuestions.Add(new CustomGridQuestion {
                         text = q.text.ToString(), type = QuestionTypes.getStringValue(q.type)
                     });
                 }
                 gridResultQuestions.DataSource = customGridQuestions;
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
     }
 }
Exemple #2
0
 public override string ToString()
 {
     return(QuestionTypes.getStringValue(value));
 }