Checkboxes with Repeaters and DataGrids

  • Thread starter Fresh Air Rider
  • Start date
F

Fresh Air Rider

I am having trouble getting checkboxes to work within Repeaters and
DataGrids

I have tried to access the value of each checkbox within a repeater
which has been ticked as follows :-

string sValues ="values";
foreach (RepeaterItem ri in rptrPublications.Items){
CheckBox cbx = (CheckBox)ri.FindControl("cbxPub");
if(cbx.Checked){
sValues = sValues + cbx.Checked.ToString();
}
}
Response.Write(sValues);

For some reason, it doesn't recognise the cbx.Checked statement, but
if I remove this line, it happily writes out the values of each
checkbox.

I am also having getting a checkbox's OnCheckedChanged event to fire
when it's within either s Repeater or a DataGrid

Could anyone please put forward some suggestions ?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,831
Latest member
HealthSmartketoReviews

Latest Threads

Top