The documentation you linked to shows how to do a group list of dataobjects (Module in their example). You want do a grouped list of pages, so you need to alter the code a little to fit your needs.
Page.php
class Page extends SiteTree {
// ...
public function getTitleFirstLetter() {
return $this->Title[0];
}
public function getGroupedChildren() {
return GroupedList::create($this->Children()->sort('Title'));
}
}
Your template
<% loop $GroupedChildren.GroupedBy(TitleFirstLetter) %>
<h3>$TitleFirstLetter</h3>
<ul>
<% loop $Children %>
<li>$Title</li>
<% end_loop %>
</ul>
<% end_loop %>