467,906 Members | 1,618 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,906 developers. It's quick & easy.

Binding custom data object to checkbox list?

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!

Aug 15 '06 #1
  • viewed: 2935
Share:
3 Replies
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..


"cannontrodder" <ne**********@gmail.comwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
>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!

Aug 15 '06 #2
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?
Islamegy® wrote:
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..


"cannontrodder" <ne**********@gmail.comwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
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!
Aug 15 '06 #3
Ah, looks like I need to use the colelction syntax:

http://support.microsoft.com/?id=307860
cannontrodder wrote:
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?
Islamegy® wrote:
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 workof
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..


"cannontrodder" <ne**********@gmail.comwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
>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!
>
Aug 15 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Rodney Lane | last post: by
11 posts views Thread by Rourke Eleven | last post: by
19 posts views Thread by Simon Verona | last post: by
reply views Thread by Larry Serflaten | last post: by
3 posts views Thread by Simon Tamman | last post: by
9 posts views Thread by =?Utf-8?B?VGVycnk=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.