子组合框值应根据选择父组合框进行更改 [英] child combo box values should change as per selection parent combo box

查看:71
本文介绍了子组合框值应根据选择父组合框进行更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的表单中有2个组合框1.State 2.City

根据状态组合框值的选择,城市组合框中的值应该更改。



这背后是否知道任何一个逻辑?

In my form there are 2 combo box 1.State 2.City
As per selection of state combo box value, values in city combo box should change.

Is any one know logic behind this?

推荐答案

Hi Yogi,



在父组合框的文本更改事件中,根据父组合的选定值填充子组合框的值。
Hi Yogi,

On the text change event of parent combo box, populate the values of child combo box based on the selected value of parent combo.


如何填充子组合框的值。 />


你可以给我更多提示或给我相同的代码。



提前致谢。
how to populate values of child combo box.

can you give me more hints or give me code for the same.

Thanks in advance.


On
SelectedIndexChanged

父组合框的事件将选定的值传递给计算子组合框的预期值的方法然后列出该值的列表,并将该列表分配给子组合框'的

event of parent combo box pass the selected value to a method that calculates the expected value for the child combo box and then make a list for that values and assign that list to the child combo box''s

DataSource

属性。


这篇关于子组合框值应根据选择父组合框进行更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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