populate combobox from List<>

  • Thread starter Thread starter zleug
  • Start date Start date
Z

zleug

Guest
Hi All.

I created classes to populate two dependent combobox

public static List<Employee> GetEmployees(string department)
{
return new List<Employee>();
}

public static List<string> GetDepartment()
{
using (DeptModel context = new DeptModel())
{
List<string> departments = context.DeptEmployees.Select(d => d.Department).Distinct().ToList();
return applications;
}
}

public void PopulateDeptCombo()
{
List<string> departments = GetDepartment();
cbDept.ItemsSource = departments;
}

How populate and filter EmpCombo depended selection in DeptCombo? Both used same entity table.

Thanks.

Continue reading...
 
Back
Top