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
close icon

ColStyles in Virtual Mode

Am using the Syncfusion Grid in virtual mode supplying the cell data using this method, but have been allowing the grid's own data cache to supply base styles, including column styles which we tweak as necessary upon grid initialization. A problem we are experiencing is that if we have more columns than the default of 10, the ColStyles cache in the grid does not expand to suit the number of columns we specify in the QueryColCount event. Is there any way to get the grid to refresh its cache to expand the number of ColStyles to suit the actual number of columns, without having to supply our own ColumnStyle cache and answer that information in QueryCellInfo? We want to be able to add and remove columns dynamically, so don't want to assume some number of maximum columns. Thanks, Wayne.

1 Reply

AD Administrator Syncfusion Team November 19, 2003 12:22 PM UTC

In a virtual grid, the grid does not allocate any storage for row and column objects. In order to get the grid to allocate storage for these column styles, you would have to explicitly set either grid.ColCount or gridModel.Data.ColCount to reflect the values you need to have. You cannot just provide the value in QueryColCount as this does not allocate storage. The difference between using grid.ColCount and grid.Model.Data.ColCount is that the latter avoids the event handling (like QueryColCount). So, if you set the colcount on the data object, I think you could still effectively use QueryColCount if you need that flexibility. Other wise, you could try removing QueryColCount and just set grid.ColCount whenever the number of your columns change.

Loader.
Live Chat Icon For mobile
Up arrow icon