473,378 Members | 1,133 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,378 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 1189
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.