private void cmbSite_SelectedIndexChanged(object sender, EventArgs e) { if (cmbSite.SelectedItem != null && ODM != null) { var site = cmbSite.SelectedItem as Site; var varbs = ODM.GetVariables(site.ID); cmbObsVars.DataSource = varbs; } }
private void cmbObsSite_SelectedIndexChanged(object sender, EventArgs e) { if (ODM != null) { var site = cmbObsSite.SelectedItem as Site; var varbs = ODM.GetVariables(site.ID); var pck = Package as IDataPackage; if (varbs != null) { var selected_var = from vv in varbs where vv.ID == pck.ODMVariableID select vv; if (selected_var != null) { cmbObsVars.DataSource = selected_var.ToArray(); } else { cmbObsVars.DataSource = null; } } } }