0

I am having a repeater which contains check-boxes,I want to fire the item_command event whenever a check-box on the repeater is checked. But since item_Command event wont fire for check-box. Googled it and heard that Bubble Event wont trigger for check box,is there some other way i can achieve this?

Thank You

Askar

LearningToCode
  • 249
  • 2
  • 15

1 Answers1

0

Thanks @Upvote MarkAnswer Finally did it... declared item_created event for the repeater and added the following code,

  protected void RptrIncdntType_ItemCreated(object sender, RepeaterItemEventArgs e)
  {
    RepeaterItem item = (RepeaterItem)e.Item;
    if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
    {
        CheckBox chkbxSafety = item.FindControl("chkbxSafety") as CheckBox;
        chkbxSafety.CheckedChanged += new EventHandler(CheckBox2_CheckedChanged);
    }
  }

 private void CheckBox2_CheckedChanged(object sender,EventArgs e)
 {
   CheckBox cb = (CheckBox)sender;
 }
LearningToCode
  • 249
  • 2
  • 15