We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataBoundGrid PrepareViewStyleInfo Event

Thread ID:

Created:

Updated:

Platform:

Replies:

2614 Feb 5,2003 02:06 AM UTC Feb 5,2003 03:53 PM UTC Windows Forms 4
loading
Tags: GridControl
Rajaraman
Asked On February 5, 2003 02:06 AM UTC

Hi I am preparing a class inheriting GridDataboundGrid, because i want to have own settings for my Grid, like i want to use PrepareViewStyleInfo event, but could not override it, it asks me to put shadows but even after the code in the event is not working. Where I am missing ? Regards Rajaraman

Administrator [Syncfusion]
Replied On February 5, 2003 06:40 AM UTC

In our library, all events are fired from virtual methods. So, an event named XXXXX will always be fired in a virtual method named OnXXXXX. So, if you want to 'override an event' named XXXXX, you need to override the virtual method OnXXXXX. In your case, you would override OnPrepareViewStyleInfo and do your work there. In your override, make sure you call the base class implementation so the PrepareViewStyleInfo event will be fired for any other listeners to this event (if you want to give other listeners a chance at handling the event). Just as an aside, you could just add a handler to your derived class and listen for the event as any other class could do. But if you are deriving the class, it is recommended (by MS) to do the override instead of handling the event.

Rajaraman
Replied On February 5, 2003 11:58 AM UTC

Hi I understand this. I have attached a Source Code file, please go through it, the onprepare...event is not firing. Help me where i am missing. Thanks Rajaraman > In our library, all events are fired from virtual methods. So, an event named XXXXX will always be fired in a virtual method named OnXXXXX. > > So, if you want to 'override an event' named XXXXX, you need to override the virtual method OnXXXXX. In your case, you would override OnPrepareViewStyleInfo and do your work there. In your override, make sure you call the base class implementation so the PrepareViewStyleInfo event will be fired for any other listeners to this event (if you want to give other listeners a chance at handling the event). > > Just as an aside, you could just add a handler to your derived class and listen for the event as any other class could do. But if you are deriving the class, it is recommended (by MS) to do the override instead of handling the event.

Administrator [Syncfusion]
Replied On February 5, 2003 02:31 PM UTC

The signature of OnPrepareViewStyleInfo is wrong. In VB, you can use the ClassName and MethodName dropdowns at the top of the edit window in Visual Studio to avoid this problem. Visual Studio will put in the proper stub for you if you use these dropdowns to do your overrides. In your code, you don't have to worry about casting any sender object as the Me variable will refer to the gird in question. And the sender object is not one of the arguments.
Public Class MyGrid
    Inherits GridDataBoundGrid

    Protected Overrides Sub OnPrepareViewStyleInfo(ByVal e As GridPrepareViewStyleInfoEventArgs)

    End Sub
End Class


Rajaraman
Replied On February 5, 2003 03:53 PM UTC

Thanks Clay Regards Rajaraman

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;