如何根据从另一个组合框中进行的选择来填充组合框(How to populate a combo box based on the selection made from another combo box)
嗨,我正在使用Visual Studio 2010 C#。 我想基于在顶部组合框中选择的车辆制作来填充我的车辆模型组合框,例如,如果有人为制造商选择本田,则第二个组合框应该仅填充本田模型,因此crv,legend,hrv等我有还创建了一个2008 SQL服务器数据库,其中包含两个表,一个用于车辆制造,另一个用于模型。 感谢名单
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
最满意答案
if (ComboVehicleMake.SelectedValue != null && Convert.ToInt32(ComboVehicleMake.SelectedValue) == 27) { try { .......// bind the other combobox if (ComboVehicleMake.SelectedValue != null && Convert.ToInt32(ComboVehicleMake.SelectedValue) == 27) { try { .......// bind the other combobox更多推荐
发布评论