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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Splitter and PrepareViewStyleInfo

Thread ID:

Created:

Updated:

Platform:

Replies:

1758 Nov 22,2002 07:02 PM UTC Dec 2,2002 09:32 PM UTC WinForms 4
loading
Tags: GridControl
Ivan Pelly
Asked On November 22, 2002 07:02 PM UTC

PrepareViewStyleInfo seems to fire only for cells in one of the panes, regardless of the number of splits you have going. Cells in any other of the panes don't get the benefit of any formatting that happens in PrepareViewStyleInfo. A bug, or a tired user?

Administrator [Syncfusion]
Replied On November 22, 2002 08:46 PM UTC

There is a certain pattern/rules you have to follow. Check out all the DataBound samples, e.g. the GBGGMultiHeader. 1. In the PaneCreated event handler you should subscribe to events in the new grid pane. In PaneClosing you should unsubscribe. 2. When you handle events from the grid you should not assume that the Grid that was initially created is still there. The pane might have been destroyed. What will remain alive is the model, but the view might be destroyed. So, when you handle events like PrepareViewStyleInfo you should cast the sender to GridControlBase or GridDataBoundGrid and use the object instead of the gridDataBoundGrid1 member variable that was created at design time. You could of course also cache the model instead. Stefan

Ivan Pelly
Replied On December 2, 2002 02:57 PM UTC

Thanks for the response. My first reaction is, "You're kidding, right?" Since you're not kidding, could I respectfully suggest implementing some developer-friendly default behaviors in a future release? I'm sure the scenario you describe has its benefits, but I bet 99% of developers just want common sense behavior that mimics Excel and/or ComponentOne and Infragistics grids - in this case, have the PrepareViewStyleInfo event fire for all visible cells, regardless of splits. Thanks in advance!

Ivan Pelly
Replied On December 2, 2002 07:01 PM UTC

I looked at the example you suggested, but GridDataBoundGrid doesn't seem to have PaneCreated or PaneClosing events (the example uses the GridRecordNavigationControl, which does have these events). Any suggestions? Thanks!

Administrator [Syncfusion]
Replied On December 2, 2002 09:32 PM UTC

Ivan, The PaneClosing and PaneCreated are members of the SplitterControl class. The sample, GDBGMultiHeader, that Stefan referred you to uses a GridRecordNavigationControl which derives from SplitterControl. So PaneClosing and PaneCreating events are found there as well. He was pointing you to the sample code used there to hook and unhook several grid events in the handlers for the PaneClosing and PaneCreated events. Attached, you will find a simple sample using PrepareViewStyleInfo to draw a red cell in a GridDataBoundGrid embedded in a SplitterControl. Regards, Clay

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

;