Inherited datagrid does not sort with OnBubbleEvent

Discussion in 'ASP .Net' started by Pat, Sep 15, 2004.

  1. Pat

    Pat Guest

    Hi all:

    I have a custom datagrid that has a row of buttons in its header (it
    serves as a toolbar).

    I'm overriding the OnBubbleEvent to handle the clicks for these child
    buttons.

    However, when I override the OnBubbleEvent, the grid does not sort or
    page! Any ideas?

    Thanks:

    Pat
     
    Pat, Sep 15, 2004
    #1
    1. Advertising

  2. Hi, Pat,

    Did you call base.OnBubbleEvent (or in VB.NET MyBase.OnBubbleEvent)?
    Moreover, you can check if the event was actually handled by the base class
    implementation and execute your code only if it was not handled (not
    recognized as sort, page, prev, next, select, delete, etc. command):

    protected override bool OnBubbleEvent(object s, EventArgs e)
    {
    bool result = base.OnBubbleEvent(s, e);
    if(result)
    {
    // the event was not for you - it was handled by the
    // System.Web.UI.WebControls.DataGrid implementation
    }
    else
    {
    // ok, it's you now:
    if(YourCondition)
    {
    // TODO: Your code
    ....
    // mark that the event was handled by you:
    result = true;
    }
    }
    return result;
    }

    Greetings
    Martin
    "Pat" <> wrote in message
    news:...
    > Hi all:
    >
    > I have a custom datagrid that has a row of buttons in its header (it
    > serves as a toolbar).
    >
    > I'm overriding the OnBubbleEvent to handle the clicks for these child
    > buttons.
    >
    > However, when I override the OnBubbleEvent, the grid does not sort or
    > page! Any ideas?
    >
    > Thanks:
    >
    > Pat
     
    Martin Dechev, Sep 15, 2004
    #2
    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. Andreas Klemt
    Replies:
    0
    Views:
    483
    Andreas Klemt
    Jul 4, 2003
  2. Andreas Klemt
    Replies:
    0
    Views:
    1,781
    Andreas Klemt
    Jul 4, 2003
  3. David Waz...
    Replies:
    0
    Views:
    423
    David Waz...
    Jul 4, 2003
  4. Dan
    Replies:
    5
    Views:
    470
    Dan Poincelot
    Nov 16, 2004
  5. Andreas Klemt
    Replies:
    1
    Views:
    145
    Tim Pacl
    Jul 18, 2003
Loading...

Share This Page