A
aaa
Hi,
I have a repeater that is assign an object and cranks out a bunch of
checkboxes.
That part works fine. In the object I am also passing over the values to
switch the checkboxes on and off.
How do I do that after the fact? I have tried looping thu after the
datasource is assigned but that doen't work.
And also how do I access each of the textbox controls by name if I don't
know what the name of the control is?
rptr.DataSource = _myobject;
rptr.DataBind();
foreach (RepeaterItem ri in rptr.Items)
{
CheckBox cbx = (CheckBox)ri.FindControl("ctl14_Checkbox_1");
if (cbx !=null)
{
cbx.Checked = true;
}
}
I have a repeater that is assign an object and cranks out a bunch of
checkboxes.
That part works fine. In the object I am also passing over the values to
switch the checkboxes on and off.
How do I do that after the fact? I have tried looping thu after the
datasource is assigned but that doen't work.
And also how do I access each of the textbox controls by name if I don't
know what the name of the control is?
rptr.DataSource = _myobject;
rptr.DataBind();
foreach (RepeaterItem ri in rptr.Items)
{
CheckBox cbx = (CheckBox)ri.FindControl("ctl14_Checkbox_1");
if (cbx !=null)
{
cbx.Checked = true;
}
}