如何根据从另一个组合框中进行的选择来填充组合框(How to populate a combo box based on the selection made from another combo b

系统教程 行业动态 更新时间:2024-06-14 16:57:18
如何根据从另一个组合框中进行的选择来填充组合框(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

更多推荐

本文发布于:2023-04-12 20:28:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/ec779ac7af9ac4c2faf39a5eb5ece485.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:组合   框中   populate   combo   based

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!