Here is the actual solution

Here is the actual solution

Grid view is not ready at the time we apply text with me.getView().refresh() so that's reason following works as the private method me.getView().applyFirstRefresh() internally having defer for view to get ready.
Please try this....