I have a checkbox that comes from DB inside repeater. I have to disable few checkboxes based on a click of one checkbox. and disable one particular checkbox based on the click of any other checkboxes.
<%# DataBinder.Eval(Container.DataItem, "PrivilegeDescription")%>
* <%# DataBinder.Eval(Container.DataItem, "Instruction")%>
protected void rptPrivilegeCheckboxes_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
string privValue = DataBinder.Eval(e.Item.DataItem, "PrivilegeID").ToString();
((CheckBox)e.Item.FindControl("chkPrivilege")).InputAttributes.Add("Value", privValue);
}
}

Priyanga Subramanian4 reputationPosted Feb 3, 2020, 11:47 AM EST
Amit MohantyRank #112 · 20K reputationPosted Feb 3, 2020, 5:51 PM EST