private void button2_Click(object sender, EventArgs e)
        {
            if (lst_Variables.SelectedItem != null)
            {
            var QueryResults =
                   from DataRowView rowView in dt.AsDataView()
                   where rowView.Row.Field<string>("Variable_Name") == lst_Variables.SelectedItem.ToString()
                   select rowView;

                SDTM_Variable var = new SDTM_Variable
                {
                    Variable_Name = QueryResults.First().Row["Variable_Name"].ToString(),
                    Variable_Label = QueryResults.First().Row["Variable Label"].ToString(),
                    Variable_Ord = int.Parse(QueryResults.First().Row["Seq#_For_Order"].ToString()),
                    Variable_Role = QueryResults.First().Row["Role"].ToString(),
                    Variable_Length = int.Parse(QueryResults.First().Row["Length"].ToString()),
                    Variable_DataType = QueryResults.First().Row["Type"].ToString(),
                    Variable_Core = QueryResults.First().Row["Core"].ToString(),
                    //Keyseq and comment have been intentionally left off as they do not come from the pre-defined list.
                    //Decimals and Datatype will be populated now, but may be reset later on based on SAS results.
                };
                Domain.Domain_Variables.Add(var);
                Parent.PopulateVariableList();
                this.Close();
            }
        }
 public SDTM_Variable_Form(SDTM_Domain domain, string variable_name)
 {
     InitializeComponent();
     Domain = domain;
     Variable = domain.Domain_Variables.Find(x => x.Variable_Name == variable_name);
     PopulateVarInfo();
     HideAll();
     PopulateStudyDatasets();
     PopualteStudyLibnames();
     PopulateFormatList();
 }