473,216 Members | 1,311 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,216 software developers and data experts.

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
3 3161
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Alan Silver | last post by:
Hello, I'm trying to use an ArrayList to do data binding, but am getting an error I don't understand. I posted this in another thread, but that was all confused with various other problems,...
2
by: Rodney Lane | last post by:
Hi, I am using an oledb data adapter to connect to an MSAccess 2003 database. I use bindings on my windows forms to bind fields to the controls and for text boxes and grids it has been fine. ...
11
by: Rourke Eleven | last post by:
I have looked and searched. What good is the databind property on Radiobuttons? How does one go about actually using it? What is a good resource on this? I understand that I can easily get/set...
19
by: Simon Verona | last post by:
I'm not sure if I'm going down the correct route... I have a class which exposes a number of properties of an object (in this case the object represents a customer). Can I then use this...
0
by: Larry Serflaten | last post by:
I am not sure how many are aware of this sort of data binding, but as it is new to many (classic) VB developers I thought I would post this once just to let people know of its availablility. ...
1
by: nate axtell | last post by:
In VB .Net I made a custom CheckBox column style (for the Datagrid control) that maps to two DataTable columns , one it uses for the Checked status and the other it uses for the Enabled status. I am...
3
by: Simon Tamman | last post by:
I've come across an interesting bug. I have workarounds but i'd like to know the root of the problem. I've stripped it down into a short file and hope someone might have an idea about what's going...
3
ADezii
by: ADezii | last post by:
The process of verifying that an Object exists and that a specified Property or Method is valid is called Binding. There are two times when this verification process can take place: during compile...
9
by: =?Utf-8?B?VGVycnk=?= | last post by:
Think it is great the way that you can set up a datsource, value member, and display member for a combobox, and map a 'code' to a 'description' and back again by binding the combobox to a...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.