在下拉列表中绑定城市 [英] bind city in dropdown list

查看:77
本文介绍了在下拉列表中绑定城市的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi frnds,

单击按钮(新建)时,我想在下拉列表中默认为city ="pune".
当更改国家/地区时,然后根据该国家/地区自动更改城市..该编码已完成,但我想在默认情况下在单击按钮(新建)的下拉菜单中设置国家(印度)和城市(浦那)..
那我该怎么办? 请帮助我.....
在此先感谢...

hi frnds,

i want to default city="pune" in dropdown when click on button(New).
when change country then automatically change city according to that country..that coding done but i want to set by default country(india) and city(pune) in dropdown on click button(New)..
so how can i do??
plz help me.....
thanks in advance...

推荐答案


检查此
c#组合框selectedindexchanged事件 [如何获取绑定中的所有值下拉菜单,取决于另一个下拉菜单 [ ^ ]

Hi ,
Check this
c# combobox selectedindexchanged events[^]

how to get bind all the values in drop down depending upon the other drop down[^]

Google[^]

报价:

默认国家(印度)和城市(浦那)

default country(india) and city(pune)


DropDownList1.SelectedValue = "20";


在数据库中将 SelectedValue设置为其值
最好的问候
M.Mitwalli


set SelectedValue with The value of it in DataBase
Best Regards
M.Mitwalli


在绑定下拉列表后尝试以下代码.

Try following code after Binding your Dropdown.

ddlCountry.SelectedItem.Text.Trim()="India";
ddlCity.SelectedItem.Text.Trim()="Pune";



注意:您也可以尝试Dropdown的SelectedValue属性

谢谢



Note : You can also try the SelectedValue property of Dropdown

Thanks


这篇关于在下拉列表中绑定城市的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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