Binding custom data object to checkbox list?

C

cannontrodder

I am displaying names and other details of my users in a Formview
control by binding my custom business object to it. My custom object
also has a property that is a collection of boolean values and I would
like to show a checkboxlist within my formview to represent them.

I just have no idea how to bind this collection to a list within the
formview? Has anyone got any ideas on this? I don't need the full code,
just a pointer in the right direction!
 
I

Islamegy®

first why do u bind checkboxlist to collection of boolean?! those values
will be the text or the value??
it's meaningless as i see.

anyway if the custom object has a property has a collection of boolean then
bind checkboxlist to this property but this property getter do the work of
getting these values(ex. master-details you must call fill method of the
child)..

objectDataSource won't be able to invoke fill method of the values..
 
C

cannontrodder

Well the collection indicates which roles a user is in. EG:
roles("admin")=False

That seems a logical way to store it internally??

I'm having trouble following what you are saying here. This is my
declaritive code:

<asp:Label runat="server" Text='<%# Eval("Username") %>' />
<asp:Label ID="Label5" runat="server" Text='<%# Eval("Email") %>' />
<asp:Label ID="Label6" runat="server" Text='<%# Eval("Firstname") %>'
/>
<asp:Label ID="Label7" runat="server" Text='<%# Eval("Lastname") %>' />

<asp:CheckBoxList ID="CheckBoxList1" runat="server" />

Username, Email, Firstname, Lastname and UserRoles are all members of
the data object that the formview is bound to. I just can't see how I
would declaratively bind that collection in the CheckBoxList tag above?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top