Inherited datagrid does not sort with OnBubbleEvent

  • Thread starter Thread starter Pat
  • Start date Start date
P

Pat

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
 
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top