如何在编辑时进行更改下拉列表? [英] how to make change dropdownlist on edit ?

查看:108
本文介绍了如何在编辑时进行更改下拉列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I 3 DropDownList国家,州,城市

>国家/地区绑定PageLoad

>状态绑定国家SelectIndexChange事件

> ; City绑定状态SelectIndexChange事件



但是当我编辑数据并且只想要状态或城市更改所以他们没有显示列表,所以

我想改变所选国家或州的州或城市



i希望你理解

//所有Bind From数据库

I 3 DropDownList Country,State, City
>Country Bind when PageLoad
>State Bind on Country SelectIndexChange event
>City Bind on State SelectIndexChange event

But when i Edit data And want only state OR city change so they no display list, so
I want to change on state or city of selected country or state

i hope u understand
//all Bind From database

推荐答案

数据编辑时,

1)从ds / dt中选择数据
2)按选定项目文本的ReBind下拉列表,

Ex。

[选择S.stateid,S.state FROM state AS S INNER JOIN country AS C on S.countryid = C.countryid where c.countryname =' CountryName'ORDER BY S.state]

3)设置ds / dt的SelectedItem。
When Data editing ,
1)Select data from ds/dt
2)ReBind dropdown by selected item text,
Ex.
[select S.stateid ,S.state FROM state AS S INNER JOIN country AS C on S.countryid=C.countryid where c.countryname= 'CountryName' ORDER BY S.state]
3)set SelectedItem of ds/dt.


这篇关于如何在编辑时进行更改下拉列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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