User-501297529 posted
When I select a different value from the cmbFman dropdown it adds the same value everytime. So if I selected a different name from the cmbFman dropdown I get another duplicate value added to the cmbOSA dropdown. Here is my code I thought .AddRange had something
to do with it but when I remove that code I don't get anything in the cmbOSA dropdown. That's probably not surprising.
private void cmbFman_SelectedIndexChanged(object sender, EventArgs e)
{
PopulateDropdown();
}
public void PopulateDropdown()
{
IQueryable<VECTRENLOCATION> locs = dc.VECTRENLOCATIONs.Where(f => f.INACTIVE != 1 || f.INACTIVE == null || pre_IsLookup);
if (FormOSAOverride == null || FormOSAOverride == "")
locs = locs.Where(f => UserSession.UserLocationList.Contains(f.BILLCODE + "-" + f.COMPANYNUMBER));
else
locs = locs.Where(f => FormOSAOverride.Split(',').Contains(f.id.ToString()));
loadedOSAs = locs.OrderBy(f => f.OSA).ToList();
cmbOSA.Items.AddRange(loadedOSAs.ToArray());
}