In my table of contents, part is defined like this:

\setuplist[part][pagenumber=no]


I would like to center align the title of the part, so it appears like this in the table of contents:

 __________
| Contents |
|          |
|  Part 1  |
| Ch. 1..1 |
| Ch. 2..5 |
| Ch. 3.10 |
|__________|


I have consulted the article about setuplist at the ConTeXt wiki, but I can see no options for horizontally aligning the entries.

-
Does \setuplist [part] [ pagenumber=no, alternative=a, align=middle, ] achieve what you want? –  phg May 12 '12 at 1:18
This almost centers the entries, but it is to the right of center. –  Village May 12 '12 at 14:04

Defining a dedicated list alternative may be the wisest choice:

\unprotect

%%% We’ll wrap the header title into a frame for convenience.
\defineframed [centered_list_frame] [
frame=off,
align=middle,
]

%%% A new list alternative employing the frame. The three args are:
%%% #1 -> Item number.
%%% #2 -> Item title.
%%% #3 -> Page number (ignored in this example).
\definelistplacement [centered_list_placement]#1#2#3{%
\centered_list_frame{\words\sc Part #1:\hskip\emwidth#2}%
}

%%% Here instruct the part list to use the new list alternative.
\setuplist [part] [alternative=centered_list_placement,]

\protect

\starttext

\placelist [part,chapter]

\dorecurse{3} {\part{foo} \dorecurse{5}{\chapter{bar}}}

\stoptext


This way you have complete control over the three items that constitute the TOC entry and can center align them at will.

-