选择下拉列表时自动选择单选按钮 [英] Automatically select a radiobutton when selecting a drop down list

查看:126
本文介绍了选择下拉列表时自动选择单选按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有4个单选按钮和4个下拉列表的分组列表
每个单选按钮都有相应的下拉列表
如果我从下拉菜单之一中选择一项,是否可以选择相应的单选按钮?
我的单选按钮之一是否具有相应的文本框?我该如何链接它们?要找出选择哪个索引,只需检查DropDownList.SelectedIndex属性.


在DropDown.SelectedIndexChanged中,您必须放置代码 radiobutton1.Checked = True .但是在此之前,您必须为DropDownlist设置 autopostback = True.

希望对您有帮助.


I have a grouped list of 4 radio buttons & 4 drop down lists
each radio button has a corresponding drop down list
Is it possible to have the corresponding radio button selected if I select an item from one of the drop down?
if one of my radio buttons has a corresponding textbox? how can i link them?

解决方案

All you have to do is set RadioButton.Checked = true in the DropDownList.SelectedIndexChanged event handler for your corresponding controls. To find out which index is selected, just check the DropDownList.SelectedIndex property.


In DropDown.SelectedIndexChanged you have to place the code of radiobutton1.Checked=True. But before that you have to set autopostback= True for DropDownlist.

Hope this can help You.


这篇关于选择下拉列表时自动选择单选按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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