CollectionEditor Remove button event?

Discussion in 'ASP .Net Building Controls' started by lisa@starways.net, Jun 28, 2005.

  1. Guest

    I have a custom CollectionEditor. It's not very customized, and is
    almost the same as any standard CollectionEditor.

    A problem I have, which isn't really a problem, but is irksome, is that
    when I go into the CollectionEditor and click on the Remove button, the
    control in design mode doesn't update until I close the CollectionForm.

    I figure this is wrong, because when I click on the Add button, it
    *does* update. And as I said, it's not that big of a deal, because it
    does update when I close the CollectionForm.

    But I'd like to trap the button click event, so that I can at least see
    what's going on. Maybe there *is* a problem, and I just haven't
    noticed it yet.

    I used the Reflector and found out that there's a private class called
    CollectionEditorCollectionForm which has this method:

    Private Sub RemoveButton_click(ByVal sender As Object, ByVal e As
    EventArgs)

    That's nice and all, but it doesn't seem to be accessible to me. I'd
    have to create an entire CollectionForm from scratch, I think, and it
    doesn't seem worth the effort.

    Does anyone know how I can accomplish this?

    Thanks,
    Lisa
    , Jun 28, 2005
    #1
    1. Advertising

  2. Hi Lisa,

    Don't know if this will help you because I always design my own forms for
    modifying my controls in the IDE. If you can somehow be alerted when this
    remove occurs then you can make the update happen like this:

    Dim x As New YourDesigner
    x.Initialize(Me (or reference to your control))
    x.MarkChange()

    This will cause the control to update in the design view. Since you can't
    capture the button click is there an OnRemove event or anything else you can
    tie into to run the code above? If not you may need to add some type of
    event to your CollectionEditor that you can somehow capture to tell your
    designer to go ahead and update the control. Good luck! Ken.

    --
    Ken Dopierala Jr.
    For great ASP.Net web hosting try:
    http://www.webhost4life.com/default.asp?refid=Spinlight
    If you sign up under me and need help, email me.

    <> wrote in message
    news:...
    > I have a custom CollectionEditor. It's not very customized, and is
    > almost the same as any standard CollectionEditor.
    >
    > A problem I have, which isn't really a problem, but is irksome, is that
    > when I go into the CollectionEditor and click on the Remove button, the
    > control in design mode doesn't update until I close the CollectionForm.
    >
    > I figure this is wrong, because when I click on the Add button, it
    > *does* update. And as I said, it's not that big of a deal, because it
    > does update when I close the CollectionForm.
    >
    > But I'd like to trap the button click event, so that I can at least see
    > what's going on. Maybe there *is* a problem, and I just haven't
    > noticed it yet.
    >
    > I used the Reflector and found out that there's a private class called
    > CollectionEditorCollectionForm which has this method:
    >
    > Private Sub RemoveButton_click(ByVal sender As Object, ByVal e As
    > EventArgs)
    >
    > That's nice and all, but it doesn't seem to be accessible to me. I'd
    > have to create an entire CollectionForm from scratch, I think, and it
    > doesn't seem worth the effort.
    >
    > Does anyone know how I can accomplish this?
    >
    > Thanks,
    > Lisa
    >
    Ken Dopierala Jr., Jul 2, 2005
    #2
    1. Advertising

  3. Guest

    Hi Ken,

    Thanks, but being alerts when the remove occurs is pretty much the same
    thing as capturing the event. I think I'm going to have to delve more
    deeply.

    Lisa


    Ken Dopierala Jr. wrote:
    > Hi Lisa,
    >
    > Don't know if this will help you because I always design my own forms for
    > modifying my controls in the IDE. If you can somehow be alerted when this
    > remove occurs then you can make the update happen like this:
    >
    > Dim x As New YourDesigner
    > x.Initialize(Me (or reference to your control))
    > x.MarkChange()
    >
    > This will cause the control to update in the design view. Since you can't
    > capture the button click is there an OnRemove event or anything else you can
    > tie into to run the code above? If not you may need to add some type of
    > event to your CollectionEditor that you can somehow capture to tell your
    > designer to go ahead and update the control. Good luck! Ken.
    >
    > --
    > Ken Dopierala Jr.
    > For great ASP.Net web hosting try:
    > http://www.webhost4life.com/default.asp?refid=Spinlight
    > If you sign up under me and need help, email me.
    >
    > <> wrote in message
    > news:...
    > > I have a custom CollectionEditor. It's not very customized, and is
    > > almost the same as any standard CollectionEditor.
    > >
    > > A problem I have, which isn't really a problem, but is irksome, is that
    > > when I go into the CollectionEditor and click on the Remove button, the
    > > control in design mode doesn't update until I close the CollectionForm.
    > >
    > > I figure this is wrong, because when I click on the Add button, it
    > > *does* update. And as I said, it's not that big of a deal, because it
    > > does update when I close the CollectionForm.
    > >
    > > But I'd like to trap the button click event, so that I can at least see
    > > what's going on. Maybe there *is* a problem, and I just haven't
    > > noticed it yet.
    > >
    > > I used the Reflector and found out that there's a private class called
    > > CollectionEditorCollectionForm which has this method:
    > >
    > > Private Sub RemoveButton_click(ByVal sender As Object, ByVal e As
    > > EventArgs)
    > >
    > > That's nice and all, but it doesn't seem to be accessible to me. I'd
    > > have to create an entire CollectionForm from scratch, I think, and it
    > > doesn't seem worth the effort.
    > >
    > > Does anyone know how I can accomplish this?
    > >
    > > Thanks,
    > > Lisa
    > >
    , Jul 11, 2005
    #3
  4. Hi Lisa,

    When a remove occurs it should in some way update your collection. If your
    collection is wrapped in a property then the Set on the property may be
    called as soon as the remove button is clicked. In the Set you could run
    your code. Ken.

    <> wrote in message
    news:...
    > Hi Ken,
    >
    > Thanks, but being alerts when the remove occurs is pretty much the same
    > thing as capturing the event. I think I'm going to have to delve more
    > deeply.
    >
    > Lisa
    >
    >
    > Ken Dopierala Jr. wrote:
    > > Hi Lisa,
    > >
    > > Don't know if this will help you because I always design my own forms

    for
    > > modifying my controls in the IDE. If you can somehow be alerted when

    this
    > > remove occurs then you can make the update happen like this:
    > >
    > > Dim x As New YourDesigner
    > > x.Initialize(Me (or reference to your control))
    > > x.MarkChange()
    > >
    > > This will cause the control to update in the design view. Since you

    can't
    > > capture the button click is there an OnRemove event or anything else you

    can
    > > tie into to run the code above? If not you may need to add some type of
    > > event to your CollectionEditor that you can somehow capture to tell your
    > > designer to go ahead and update the control. Good luck! Ken.
    > >
    > > --
    > > Ken Dopierala Jr.
    > > For great ASP.Net web hosting try:
    > > http://www.webhost4life.com/default.asp?refid=Spinlight
    > > If you sign up under me and need help, email me.
    > >
    > > <> wrote in message
    > > news:...
    > > > I have a custom CollectionEditor. It's not very customized, and is
    > > > almost the same as any standard CollectionEditor.
    > > >
    > > > A problem I have, which isn't really a problem, but is irksome, is

    that
    > > > when I go into the CollectionEditor and click on the Remove button,

    the
    > > > control in design mode doesn't update until I close the

    CollectionForm.
    > > >
    > > > I figure this is wrong, because when I click on the Add button, it
    > > > *does* update. And as I said, it's not that big of a deal, because it
    > > > does update when I close the CollectionForm.
    > > >
    > > > But I'd like to trap the button click event, so that I can at least

    see
    > > > what's going on. Maybe there *is* a problem, and I just haven't
    > > > noticed it yet.
    > > >
    > > > I used the Reflector and found out that there's a private class called
    > > > CollectionEditorCollectionForm which has this method:
    > > >
    > > > Private Sub RemoveButton_click(ByVal sender As Object, ByVal e As
    > > > EventArgs)
    > > >
    > > > That's nice and all, but it doesn't seem to be accessible to me. I'd
    > > > have to create an entire CollectionForm from scratch, I think, and it
    > > > doesn't seem worth the effort.
    > > >
    > > > Does anyone know how I can accomplish this?
    > > >
    > > > Thanks,
    > > > Lisa
    > > >

    >
    Ken Dopierala Jr., Jul 11, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. michael
    Replies:
    0
    Views:
    432
    michael
    May 1, 2004
  2. gozza
    Replies:
    1
    Views:
    128
    gozza
    Feb 2, 2004
  3. gozza

    UrlEditor from a CollectionEditor again

    gozza, Feb 3, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    157
    gozza
    Feb 3, 2004
  4. michael
    Replies:
    0
    Views:
    107
    michael
    May 1, 2004
  5. Dmitry Nogin

    CollectionEditor - Add/Remove buttons are disabled

    Dmitry Nogin, Apr 27, 2007, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    744
    ClayB
    Apr 28, 2007
Loading...

Share This Page