From c766694bec0ec16d7dc7b52f8e48f3c4056e6d1f Mon Sep 17 00:00:00 2001
From: Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com>
Date: Wed, 15 Mar 2017 14:00:50 +0200
Subject: Allow changing renderers after column creation (#8841)

Closes #8250
---
 documentation/components/components-grid.asciidoc | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

(limited to 'documentation/components/components-grid.asciidoc')

diff --git a/documentation/components/components-grid.asciidoc b/documentation/components/components-grid.asciidoc
index ed66c45d2f..223be80e6f 100644
--- a/documentation/components/components-grid.asciidoc
+++ b/documentation/components/components-grid.asciidoc
@@ -403,9 +403,23 @@ You set the column renderer in the [classname]#Grid.Column# object as follows:
 [source, java]
 ----
 // the type of birthYear is a number
-Column<Integer> bornColumn = grid.addColumn(Person:getBirthYear,
+Column<Person, Integer> bornColumn = grid.addColumn(Person:getBirthYear,
       new NumberRenderer("born in %d AD"));
 ----
+
+Changing the renderer during runtime is also possible, but for type safety
+you should store the column reference with data types for doing this.
+When you change the renderer, the content of Grid is refreshed.
+
+[source, java]
+----
+Column<Person, Integer> ageColumn = grid.addColumn(Person::getBirthYear);
+// The default renderer is TextRenderer
+addComponent(new Button("Change renderer", 
+	clickEvent -> ageColumn.setRenderer(new NumberRenderer())
+));
+----
+
 The following renderers are available, as defined in the server-side
 [package]#com.vaadin.ui.renderers# package:
 
-- 
cgit v1.2.3

