我需要有关视觉基本代码的帮助才能在下拉列表中显示项目 [英] I need help on visual basic code to display items on a drop down list

查看:125
本文介绍了我需要有关视觉基本代码的帮助才能在下拉列表中显示项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在尝试设计一个演示航空公司预订Web应用程序.请我有两个分别名为1和2的dropdownlist控件.两个dropdownlist都从数据库连接到数据源.如果dropdownlist1上有一个项目,我希望这样做如果选中它,它将仅显示数据库中dropdownlist2上的相关项目.让我说一下是否dropdownlist1包含离开城市的航班列表.我想当我单击列表中的一个项目时,它仅显示与该城市相关的所有飞行路线路线,我单击dropdownlist2.
我想要与此网站上的控件类似的东西 http://www. acn.aero/cgi-bin/airkiosk/I7/181002i?AJ=2&LANG=EN [

Hello please i am trying to design a demo airline reservation web application.please i have two dropdownlist controls named one and two respectively.Both drop downlist are connected to a data source from a databse.I want that if an item on dropdownlist1 is selected it will display only the related items on dropdownlist2 from the database.Let me say if dropdownlist1 contain a list of flight departing a city.I want when i click on an item in the list it displays all the flight route relating to only that route i click on dropdownlist2.
i want something similar to the control on this website http://www.acn.aero/cgi-bin/airkiosk/I7/181002i?AJ=2&LANG=EN[^]
the Leaving from drop list and the going to drop list
I really appreciate the efforts of anyone that can help me out i am a novice at visual basics

推荐答案

Private Sub dropdownlist1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dropdownlist1.SelectedIndexChanged
                If Not Dropdownlist2() Then
                    Exit Sub
                End If

End Sub




当dropdownlist1选择索引更改时,绑定dropdownlist2
在dropdownlist2中,您可以添加dropdownlist1的过滤器,以便仅获取与dropdownlist1相关的项目.




Bind dropdownlist2 when dropdownlist1 selected index change
in dropdownlist2 you can add filter of dropdownlist1 so you get only those item which is related to dropdownlist1.


这篇关于我需要有关视觉基本代码的帮助才能在下拉列表中显示项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆