Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

looping through a checkboxlist in a repeater

Posted on 2011-09-14
3
Medium Priority
?
665 Views
Last Modified: 2012-08-13
In an ASP.net (C#) application, I set up a repeater to create a list of "types" of features. I've got them listed in a sql table.


Each of those "types" has a set of sub-list of features. I set up a checkboxlist in the repeater to list them all grouped by the aforementioned "type". My problem is I'm trying to use a third table to selectively check certain ones (it's not always the same ones). When the record is saved, the application puts a list of whatever was checked into this table.

The checkboxlist is repeated four times. The first three are built properly, but nothing is getting checked (there should be things). Using a Findcontrol, I always end up just checking off the items in the last iteration of that checkboxlist.

I've tried looping through rows in the repeater, but that doesn't seem to work for me as I can't seem to get my row count to work properly on databound.

The row count does work in the  PreRenderComplete event, but the page hangs if I try to run the SQL query there. I take out the query and just have it count, no problem.

So, can somebody help me out? I've been tinkering with different things and I keep getting close. I just can't get over the hump.
0
Comment
Question by:jdcollins21
[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
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 2000 total points
ID: 36540922
0
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 36541576
http://www.devcurry.com/search/label/ASP.NET?updated-max=2009-08-02T04%3A55%3A00-07%3A00&max-results=20

contains example to loop through checkboxs in a gridview. Same is applicable for repeater as well.
0
 

Author Closing Comment

by:jdcollins21
ID: 36545137
Thanks EaswaranP,

that would absolutely work. After a good night's sleep, I figured out my loop just sucked. Basically, I'd forgot to put in a way to stop it.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

721 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