Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Expert,

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

I took one radio button as follows with oncheckedchanged event

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


and there is one dropdownlist(lstEditSource) ,
eg.

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


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

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

           ddlSource.Enabled = true;
       }




but ddlSource shows null reference.

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

Please help me.

Thanks in advance.
Posted
Updated 20-Nov-11 18:42pm
v2

1 solution

hi,

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;

}
 
Share this answer
 
Comments
Richard MacCutchan 23-Nov-11 8:57am    
Use <pre> tags around code!
udusat13 24-Nov-11 1:48am    
Thanks....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900