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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

StyleInfo and PrepareViewStyleInfo

Thread ID:





22214 Dec 7,2004 11:33 AM UTC Dec 7,2004 12:14 PM UTC WinForms 1
Tags: GridControl
Gil Kalo
Asked On December 7, 2004 11:33 AM UTC

As I understand from http://www.syncfusion.com/Support/article.aspx?id=561 there is no storage allocated for the RowStyles. This causes to do any style configuration and presentation logic in the "PrepareViewStyleInfo" event. For example: I need to change the back color for some rows in a grid. Detecting the rows to select and changing the color are coded in the "PrepareViewStyleInfo". In addition, some columns should contain images. The image logic, which image to which cell should also be in the "PrepareViewStyleInfo" event. Writing lots of presentation logic in this event can cause a slow scroll performance! But I don''t see any other way. Is there a way to do all this logic out of the "PrepareViewStyleInfo" event? If not, how you suggest to handle the performance problam which is raised by this? Thanks, Gil K

Administrator [Syncfusion]
Replied On December 7, 2004 12:14 PM UTC

Not if you are using a GridDataBoundGrid. If you use a GridControl, then rowstyles are available. In PrepareViewStyleInfo, try having minimal code that essentially only does minimal lookups and not a whole tour de force of conditional logic. So, in whatever the trigger mechanisn you are using to decide to color certain rows (or set other properties), you can prepare a ArrayList or Hashtable of objects that hold the state information you need. Then in PrepareViewStyleInfo, you retrieve this state information and use it. You do not have to decide what state information should be used at that point. This is how you would want to handle any state information that is time consuming to generate. But if it is something like coloring alternating rows, this would probably be simpler just to compute the state on the fly, instead of trying to cache it, and retrieve it.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon