如何在单选按钮选中的事件上访问editmode listview控件? [英] How to access editmode listview control on radiobutton checked event?

查看:61
本文介绍了如何在单选按钮选中的事件上访问editmode listview控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

专家,

在listview( lstvwResultInquiry )EditTemplate中,有许多处于编辑模式的控件.

我在oncheckedchanged事件中按下了一个单选按钮,如下所示:

Hi Expert,

In listview(lstvwResultInquiry) EditTemplate there are many controls in edit Mode.

I took one radio button as follows with oncheckedchanged event

<asp:RadioButton ID="radioSource" runat="server" AutoPostBack="True"
                           GroupName="inquiryRadio" oncheckedchanged="radioSource_CheckedChanged" />



并且有一个dropdownlist( lstEditSource ),
例如.



and there is one dropdownlist(lstEditSource) ,
eg.

<asp:DropDownList ID="lstEditSource" runat="server" Width="175px"  Height="23px">



我在 radioSource_CheckedChanged 事件上使用了以下代码来启用dropdownlist(< b> lstEditSource</b>)



I used following code on radioSource_CheckedChanged event to enable dropdownlist(<b>lstEditSource</b>)

if (lstvwResultInquiry.EditIndex > -1)
       {
           DropDownList ddlSource = (DropDownList)lstvwResultInquiry.EditItem.FindControl("lstEditSource");

           ddlSource.Enabled = true;
       }





但ddlSource显示空引用.

如何在单选按钮选中的事件上访问这些editmode listview控件?

请帮帮我.

在此先谢谢您.





but ddlSource shows null reference.

How to access these editmode listview control on radiobutton checked event?

Please help me.

Thanks in advance.

推荐答案



在单选按钮选中的更改事件中使用以下代码

保护虚空......
{
foreach(lstvwResultInquiry.Rows中的GridViewRow grv)
{
DropDownList ddlSource =(DropDownList)grv.FindControl("lstEditSource");


ddlSource.Enabled = true;

}


use the following piece of code in the radiobutton checked change event

protect void ......
{
foreach (GridViewRow grv in lstvwResultInquiry.Rows)
{
DropDownList ddlSource = (DropDownList)grv.FindControl("lstEditSource");


ddlSource.Enabled = true;

}


这篇关于如何在单选按钮选中的事件上访问editmode listview控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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