Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Inherited datagrid does not sort with OnBubbleEvent (http://www.velocityreviews.com/forums/t86749-inherited-datagrid-does-not-sort-with-onbubbleevent.html)

Pat 09-15-2004 03:13 PM

Inherited datagrid does not sort with OnBubbleEvent
 
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 09-15-2004 04:48 PM

Re: Inherited datagrid does not sort with OnBubbleEvent
 
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" <pol8985@njit.edu> wrote in message
news:4ccf7844.0409150713.32da9445@posting.google.c om...
> 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





All times are GMT. The time now is 10:33 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.