How can I trap a user control event from a datarepeater

Kilitli How can I trap a user control event from a datarepeater

  • 11 Kasım 2011 Cuma 19:40
     
     

    I have a user control I've built that consists of several radio buttons in group boxes. I want to trap the radiobutton.CheckedChanged event for each group.

    I've declared Public Events with a boolean parameter and raise the appropriate event on CheckedChanged, but the event doesn't make its way out of the DataRepeater.

    I have the user control bound to a datasource and the data is updated, but I need to expose other controls outside of the repeater depending on the RadioButton values. Stepping through the code I see the event being raised in the control, but it is never trapped.


    David M. Nichols contract software engineer

Tüm Yanıtlar

  • 14 Kasım 2011 Pazartesi 06:04
    Moderatör
     
     

    Hi David,

    Could you please show us your code for helping repro this issue?

    Have a nice day,


    Kee Poppy [MSFT]
    MSDN Community Support | Feedback to us
  • 14 Kasım 2011 Pazartesi 16:58
     
     

    I don't have the code available at the moment, but the user control I created ctlAdmitAction has a pair of radio buttons (rbAdmit and rbNonAdmit). I have an event   Admit(ByVal status as Boolean)    defined that passes a boolean. I raise the event in the CheckedChanged events of the radio buttons and then try to handle the event from the form I have the repeater on. I can step through the code and the event is raised within the user control, but the handler is never invoked.

    The repeater has only this control and a label in the template and I have the control bound to a property named Order. The datasource is a List(of Orders) that is added to and removed from in a listview on the same form.


    David M. Nichols contract software engineer