Click here to Skip to main content
15,884,353 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Friends I have a GridView in which two Template Field is there one is RadioButton and the next one is TextBox on the Click of the Radion Button I have to Setup an focus in the TextBox...

Multiple Selection of RadioButton Shouldn't be allowed...

And Finally It should be saved in the DataBase I will take care of the DataBase, but only the selection is important me...

Thanking you
Sushil Dharmar...
Posted
Comments
Dr.Walt Fair, PE 7-Aug-11 12:56pm    
So, what exactly is the question?

1 solution

protected void rbSelector_CheckedChanged(object sender, System.EventArgs e)
{
    //Clear the existing selected row 
    foreach (GridViewRow oldrow in GridView1.Rows)
    {
        ((RadioButton)oldrow.FindControl("rbSelector")).Checked = false;
    }
    //Set the new selected row
    RadioButton rb = (RadioButton)sender;
    GridViewRow row = (GridViewRow)rb.NamingContainer;
    ((RadioButton)row.FindControl("rbSelector")).Checked = true;
    ((TextBox)row.FindControl("textBoxID")).Focus();
}

Source[^]
 
Share this answer
 
Comments
SushilDharmar 8-Aug-11 11:53am    
now its showing an error named GridView doesnot contain a public Definition for GetEnumerator.

Thank you For you Replay Friends...

Thanking you Once Again

Sushil Dharmar

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