Repeater and add columns to header and itemtemplate on page load

Posted by sdmiller on Stack Overflow See other posts from Stack Overflow or by sdmiller
Published on 2010-04-30T22:45:02Z Indexed on 2010/04/30 22:47 UTC
Read the original article Hit count: 547

Filed under:
|
|

I haven't used repeaters for much more than showing data from a datatable.

I am building a grid that that shows a list of users and columns of roles that the user has been assigned, shown with checkboxes (shown with true/false below but pretent they are checkboxes).

ex.

|Rep Name|Caller|Closer|Manager|SuperUser| |Bob |True |true | false | false | |Tom |false |false |True | True |

Basically using it for roles management.

However the roles may change later on so I want to load the roles(headers and items) dynamically into the repeater.

I am not sure how to do this or if it is even possible.

I figure you grab a list of current role possibilities and load them into the headertemplate but I am not sure how to match those with the itemtemplate and how to create checkboxes and place them in the itemtemplate.

Sorry if it is a rudementary question.... I appreciate any advice!

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET