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

I am using radiobuttonlist and textbox in the gridview. I need to do operations on radiobuttonlist so that it should reflect on textbox . this is to be done after gridview_rowediting event fires i.e when we can see "update" and "cancel" buttons. I tried like this,
C#
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
        GridView1.EditIndex = e.NewEditIndex;

        GridViewRow editingRow = GridView1.Rows[e.NewEditIndex];

        RadioButtonList rbl = (RadioButtonList)editingRow.Cells[17].FindControl("rblist11");
        rbl.Visible = true;
        TextBox txtamt = (TextBox)editingRow.Cells[18].FindControl("TextBox3");
        txtamt.Enabled = true;
         
            if (rbl.SelectedItem.Value.Contains("1"))
            {
                txtamt.Enabled = true;
            }
            else if (rbl.SelectedItem.Value == "2")
            {
                txtamt.Enabled = true;
            }
            else if (rbl.SelectedItem.Value == "0")
            {
                txtamt.Enabled = false;
            }
       
    }

Here default selected value is "0" given in source.

My problem here is when I am changing the selecteditem, the corresponding action is not done.

if this action is not done in rowediting event, Please give me the appropriate solution.
Posted
Updated 27-Jun-10 20:55pm
v2
Comments
Sandeep Mewara 28-Jun-10 2:56am    
Pre tags are your friends to format code part. Use it next time onwards.

Use java script for this type operation on "onClick" event.
 
Share this answer
 
<asp:RadioButtonList AutoPostBack=true runat=server ID=RadioButtonList />

you need check AutoPostBack=true whether in it.
 
Share this answer
 

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