Solved

Linq: Set Checkboxlist based on values set in sql table

Posted on 2011-02-21
3
586 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
3 Comments
 
LVL 18

Expert Comment

by:carlnorrbom
Comment Utility
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
Comment Utility
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
Comment Utility
I think it has to be done in a loop.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now