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


Thread ID:





22259 Dec 8,2004 09:28 AM UTC Dec 8,2004 01:57 PM UTC WinForms 4
Tags: GridControl
Asked On December 8, 2004 09:28 AM UTC

Hello, I use Virtual Grid Control and I set the GridStyleInfo through QueryCellInfo with e.style=ModifyStyle(...) I have tried to set ColStyles through initialization but it is impossible in Virtual mode. ( ColStyles[].BaseStyle=" " or ColStyles[].ModifyStyle ). My Question is : What is the cost ( time & memory )of ModifyStyle in QueryCellInfo ? ( I use StyleModifyType.Changes and in one case StyleModifyType.Override). Except time does it waste memory ? I'' m satisfied but I wonder about any optimization . I would be very happy if the GridQueryCellInfoEventArgs.Style was not read only , to assign my style. Regards Stefan case .

Administrator [Syncfusion]
Replied On December 8, 2004 11:21 AM UTC

You can set column style properties from within QueryCellInfo. Look for e.ColIndex > 0 and e.RowIndex == -1. In this case, QueryCellInfo is working with the column style in e.Style for the column e.ColIndex. In general, style memory usage is optimized in QueryCellInfo. (That is why e.Style is readonly. It lets the grid have complete control over when this object is allocated and disposed.) If you look at the grid source, you will see that it uses ModifyStyle to combine styles in its QueryCellInfo code (Model.GetCellInfo).

Stefan Tsalapatis
Replied On December 8, 2004 01:08 PM UTC

Thanks, Clay I have seen the GetCellInfo I use IGridDataProvider and always I return with event.handled=true; I do not want anything to store in grid memory ( I know it doesn''t save data but styles for every cell ?). I wonder about the GridStyleInfoStore store; store = Data[rowIndex, colIndex]; Is there anything there that I can save memory since I work virtually. Thanks again

Administrator [Syncfusion]
Replied On December 8, 2004 01:22 PM UTC

If you have a true virtual grid (never explicitly setting grid.RowCount = xxxx or grid.ColCount = yyyy, instead always providing these values through QueryRowCount and QueryColCount), then Data[rowIndex, colIndex] will always return null. The style information used in QueryCellInfo lives as weak references in a volatile data cache. This means normally their life cycle is short and they will be garbage collected at first opportunity. They are cached in thie volatile data store to relieve the load on QueryCellInfo. There is a way for you to have more control over this volatile datastore and when QueryCellInfo is hit. In 3.0, we ship a sample that shows how you can get QueryCellInfo to be hit only once. \Syncfusion\Essential Suite\\Windows\Grid.Windows\Samples\Performance\OneTimeOnlyQueryCellInfo

Stefan Tsalapatis
Replied On December 8, 2004 01:57 PM UTC

No only IGridDataProvider.QueryRowCount >\Syncfusion\Essential Suite\ I wait the release to download :-) Regards Stefan


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