Solved

Linq: Set Checkboxlist based on values set in sql table

Posted on 2011-02-21
3
638 Views
Last Modified: 2012-05-11
I have a checkboxlist capture various pieces of data.  I capture selected checkboxes and store in a corresponding table with a '0' variable for False - not selected or '1' True - selected.  I want to reset my checkboxlist based on the record value in table.  How can I do this and is Linq possible?  If not I'm willing to right the code I just need some best practice suggestions.

See below what I have so far.

Screencast displays the checkboxlist groupings.
rtreadwell-411961.flv
0
Comment
Question by:Robert Treadwell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 18

Expert Comment

by:carlnorrbom
ID: 34949334
Hi,

Not sure I fully understand your question? What do you mean by "I want to reset my checkboxlist based on the record value in table"? You basically want to establish a two-way data binding or what? Please clarify.

/Carl.
0
 

Author Comment

by:Robert Treadwell
ID: 34951711
Yes If there is a way to two-way bind a checkboxlist that's what I want to do.  currently I'm looping through the control to determine if the listitem is selected.  if it is then I set a corresponding column to '1'. When user record is revisited,  I want to be able to retrieve that record and then look at each column and set the checkboxlist with all the selected values set previously.  Followed by, if there are any updates then setting the new updates back to database.  

Currently to set record I am using a For/next loop to check for the selected item.  i guess I could do the same thing in reverse.  but it seems to me that there has to be a easier way.  
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 35021817
I think it has to be done in a loop.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question