I want to use a datagrid to display a variable number of columns, but am struggling...

I'm able to successfully add BOUND columns at runtime but I need these new columns to be TEMPLATE columns as I want the cells to be checkboxes bound to a boolean.

Any ideas on how to accomplish this?

If it helps to visualise what I'm hoping to achieve, consider displaying a table of database role membership. The columns will be the role names and the rows will be the users.

Thanks!