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

ModifyStyle

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 .

4 Replies

AD Administrator Syncfusion Team 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).


ST Stefan Tsalapatis 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


AD Administrator Syncfusion Team 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\3.0.0.19\Windows\Grid.Windows\Samples\Performance\OneTimeOnlyQueryCellInfo


ST Stefan Tsalapatis December 8, 2004 01:57 PM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon