473,762 Members | 8,115 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3182
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)..

objectDataSourc e won't be able to invoke fill method of the values..


"cannontrod der" <ne**********@g mail.comwrote in message
news:11******** **************@ 74g2000cwt.goog legroups.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:CheckBoxLi st ID="CheckBoxLis t1" 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)..

objectDataSourc e won't be able to invoke fill method of the values..


"cannontrod der" <ne**********@g mail.comwrote in message
news:11******** **************@ 74g2000cwt.goog legroups.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:CheckBoxLi st ID="CheckBoxLis t1" 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)..

objectDataSourc e won't be able to invoke fill method of the values..


"cannontrod der" <ne**********@g mail.comwrote in message
news:11******** **************@ 74g2000cwt.goog legroups.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
1979
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, which could be why no-one answered it!! I've now narrowed the problem down, so am starting a new, more specific, thread. Sorry it's a bit long, but it's reasonably simple stuff. I have a page where I'm showing product details, including any
2
2814
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. I am having problems with binding to a check box. It works fine until I attempt to add a new record to the dataset through the binding context object.
11
4661
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 the information I need programmatically, but what about the databind property I just don't understand it's value.
19
2344
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 object to databind to text boxes etc? I can't use a dataset as the object has loads of derived logic, for example updating one property may actually update several database fields for example.
0
1528
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. There are cases where properties of one object is dependant on a property of another object. For a common example, when you bind an ArrayList to a ComboBox using the combo's DataSource property, the combo box fills up with items from the array list....
1
3596
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 having a couple problems so far. 1. with the way the Paint method works: When I scroll to the right, the custom column gets Drawn on top of the left-most "Selecting" column (the one where the green arrows are displayed). How can I possibly modify...
3
7522
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 on. It's a simple program that loads a control onto a form and binds "Foo" against a combobox ("SelectedItem") for it's "Bar" property and a datetimepicker ("Value") for it's "DateTime" property. The DateTimePicker.Visible value is set to...
3
16070
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 time (Early Binding) or run time (Late Binding). When you declare an Object Variable as a specific Data Type, you are using Early Binding so the verification can take place during compile time. When you declare a Variable of the generic Object Data...
9
2804
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 datasource that contains the code. Now suppose that you want it to be read-only? That is, you have the 'code' in your DB, want the associated 'description' to display, but not let the user change it on this particular form. There is no read-only...
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9378
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9989
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9927
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7360
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6640
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3914
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.