Click here to Skip to main content
15,905,323 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
in grid view having radio button then how to keep them enabled fasle on page load and enabled true on link buton which is present in same grid vie
Posted
Comments
Manas Bhardwaj 4-Aug-13 7:12am    
Keep your subject and description clear. I have really no clue what you problem is.

1 solution

Hi,

You can make enabled false in gridview rowdatabound event.

C#
protected void grdUrgentItem_RowDataBound(object sender, GridViewRowEventArgs e)
   {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                 //make enable false
                 CheckBox chk = (CheckBox )e.Row.FindControl("chkid");
                 chk.Enabled = false;
            }
   }


you can make enable true in gridview rowcommand event.

C#
protected void grdUrgentItem_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //make enable true
            GridViewRow row = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
                 CheckBox chk = (CheckBox )row.FindControl("chkid");
                 chk.Enabled = true;
        }



Hope it helps.
 
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