0
votes

this form adds a new enquiry witha unique reference number

Hie, am using visual studio 2010 C#. i would like to populate my vehicle model combo box based on the vehicle make selected on the top combo box e.g if someone select a honda for the make, the second combo box should only populate honda models thus crv, legend, hrv etc. i have also created a 2008 SQL server database that contains two tables, 1 for vehicle makes and the other 1 for model. thanx

2
Do you have any code so far that you could post?Paul Brindley

2 Answers

0
votes
  if (ComboVehicleMake.SelectedValue != null && Convert.ToInt32(ComboVehicleMake.SelectedValue) == 27)
    {
        try
        {
        .......// bind the other combobox
0
votes

You'll have to hook up the change event on your main combobox, and then filter or set the source of the other comboboxes depending on that selection

You could do that with properties, collections, hardcode, linq, and so on, but since you don't have any code, it's a bit hard to point you in a better direction.