private void cb_CarBrand_SelectedIndexChanged(object sender, EventArgs e) { try { dataGridView1.AutoGenerateColumns = false; dataGridView1.DataSource = model.SelectAllByBrand(int.Parse(cb_CarBrand.SelectedValue.ToString())); } catch { } }
private void cb_CarBrand_SelectedIndexChanged(object sender, EventArgs e) { try { cb_model.DataSource = model.SelectAllByBrand(int.Parse(cb_CarBrand.SelectedValue.ToString())); cb_model.DisplayMember = "CarModel"; cb_model.ValueMember = "ID"; cb_model.SelectedIndex = -1; }catch { } }