Add delegate to CollectionChanged

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alessandro Rossi

    #1

    Add delegate to CollectionChanged

    I've developed a user control, and i want to use this
    control in forms that has others controls linked to a
    dataset (TextBox). I want to add a delegate to the
    CollectionChang ed event of the currencymanager of the
    others linked control. My problem is: When i put the
    usercontrol in the form (at design time), and i run the
    application, if the bindings (of others controls) are
    created before than my control, the delegate is not added
    because my control is not yet created.
    Do you know how can i solve this problem?
    Thank you.
    Alessandro Rossi
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Add delegate to CollectionChang ed

    Allesandro,

    I think that if you change your processing, then you can accomplish what
    you want. You are using the CollectionChang ed event to determine when the
    controls attached to the currency manager have changed. Before you add the
    event handler, you will want to check the currency manager and do some
    processing on all the items already in the currency manager.

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - nicholas.paldin o@exisconsultin g.com

    "Alessandro Rossi" <alessandro.ros si@areaitsrl.co m> wrote in message
    news:176001c352 7f$f1b326c0$a00 1280a@phx.gbl.. .[color=blue]
    > I've developed a user control, and i want to use this
    > control in forms that has others controls linked to a
    > dataset (TextBox). I want to add a delegate to the
    > CollectionChang ed event of the currencymanager of the
    > others linked control. My problem is: When i put the
    > usercontrol in the form (at design time), and i run the
    > application, if the bindings (of others controls) are
    > created before than my control, the delegate is not added
    > because my control is not yet created.
    > Do you know how can i solve this problem?
    > Thank you.
    > Alessandro Rossi[/color]


    Comment

    Working...