Completed
Last Updated: 27 Jan 2016 09:45 by ADMIN
Combinations
Created on: 24 Apr 2014 12:06
Category: Grid
Type: Feature Request
3
resizeToFit not working with dynamically added contents
When using the client-side resizeToFit() method of the RadGrid to automatically adjust a column's width it seems to cache the value (the computed width). If i alter on add contents to a column's header and then re-run resizeToFit() the column doesn't fit to the new contents.
I would like an option to reset the cache, maybe with an optional parameter to the resizeToFit() method.
2 comments
ADMIN
Vasil
Posted on: 27 Jan 2016 09:45
We optimized the code using different approach, and you will not longer need to clear the cache to get resizeToFit working in Q1 2016 SP1
Combinations
Posted on: 21 Jan 2016 09:32
My current workaround is to set _cachedBestFitSize = null, like this:

function resizeArticleGridColumnToFit(columnUniqueName) {
				var grid = $find('<%= ArticleGrid.ClientID %>');
				if (grid) {
					var c = grid.get_masterTableView().getColumnByUniqueName(columnUniqueName);
					c._cachedBestFitSize = null;
					c.resizeToFit();
				}
			}