473,395 Members | 2,192 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,395 software developers and data experts.

Checkboxlist problem?

Hello,

I have a page that allows the person to select multiple items from a
checkboxlist. The checkboxlist is being populated from a table in the
database. The user's selections are sent to the database as a comma
separated list (ex. 17, 22, 35).

I also have a page that allows the user to edit existing records. I am
unsure of how to build the checkboxlist on the edit page and have the
various checkboxes checked based on what is in the particular record.

Can somebody guide me here? Would I be better of using a multi select
listbox, or would I run into the same problem in trying to display the
selections based on what is in the database?

Thank you for the help,

Lynn
Nov 19 '05 #1
1 1191
Pat
Lynn
In your Edit page u can make the checkboxes checked depending on the value
by using
FindByValue method of the CheckBoxList's Items collection.
Try looking through the article below and sure it should help
http://aspnet.4guysfromrolla.com/articles/050703-1.aspx
You can also use for example a Repeater or Datalist Control and the write a
function that would return a Boolean
and later append that to your checkBoxes.
If you need more info let me know
Patrick


"Lynn" <yeltnab1@_NOSPAM_hotmail.com> wrote in message
news:mO********************@comcast.com...
Hello,

I have a page that allows the person to select multiple items from a
checkboxlist. The checkboxlist is being populated from a table in the
database. The user's selections are sent to the database as a comma
separated list (ex. 17, 22, 35).

I also have a page that allows the user to edit existing records. I am
unsure of how to build the checkboxlist on the edit page and have the
various checkboxes checked based on what is in the particular record.

Can somebody guide me here? Would I be better of using a multi select
listbox, or would I run into the same problem in trying to display the
selections based on what is in the database?

Thank you for the help,

Lynn

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dennis Johansson | last post by:
I have a CheckBoxList like this one: <asp:CheckBoxList id="chkReport" runat="server" DataValueField="rptID" DataTextField="RptName" Enabled="False" RepeatLayout="Flow"></asp:CheckBoxList> I...
4
by: dm_dal | last post by:
Is there a know issue surrounding the CheckBoxList control and it's viewstate? When my control is created, it's ListItems are checked as needed, but on a postback, they loose their Selected...
3
by: JD | last post by:
Hello, I have a problem with checkboxlist inside Repeater (in ASP.NET page). I am able to create Checkboxlist and bind it (inside Repeater_ItemBound - including setting checked/unchecked)....
3
by: Dune | last post by:
Hi, Is there anyway to get the datavaluefield from a databound checkboxlist using javascript? If not, is there any way to associate a custom attribute with the databound checkboxlist items so...
5
by: Patrick.O.Ige | last post by:
I'm binding a CheckBoxlist below in the ItemDataBound(the CheckBoxList is in a Datalist) By doing "li.Selected = True" i can see all the checkBoxes are selected. But what i want is to be able...
4
by: Patrick.O.Ige | last post by:
I have a CheckBoxList in a DataList and i'm trying to get item Selected after doing a postBack. I have set my CheckBoxlist AutoPostBack="True" Any ideas what 'm doing wrong? It seems not to...
7
by: ThunderMusic | last post by:
Hi, I have a CheckBoxList and I want to add some javascript code to each CheckBox created by this CheckBoxList. I tried iterating through all items of the list, all the controls, do a FindControl,...
0
by: webmaster | last post by:
Hi all, I'm tearing my hair out with this one. I have successfully implemented by own RadioButtonList in order to provide additional functionality and a DIV rather than TABLE-based layout in...
4
by: haresh.amis | last post by:
hello to all, I m using .net 2.0 and i face a problem that is as under Well I have a checkboxlist which i bound in .cs page now I want to count that how many checkboxes ate checked ( In...
2
by: mercea | last post by:
hi all, i have a grid view and i have inserted a checboxlist template with 5checkboxes per row into the gridview. i want the user to be able to select an option (A-E) and that selected option be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.