S
scsharma
Hi,
I am using data grid and i want to have a checkbox as one of the column.
For that i am creating a template class and in InstantiateIn(Control
container) function i am dynamically creating a check box and adding that
check box to control collection.
Since the checkbox generates <input> tag I would like to have corresponding
label so that i can set the associatedControlID property of the label to
checkbox. But when final HTML is generated instead of <label> tag I am seeing
<span> tag.
What am i doing wrong?Please help.
Here is the code:
public void InstantiateIn(Control container)
{
CheckBox cbx = new CheckBox();
Label lbl = new Label();
cbx.DataBinding +=new EventHandler(cbx_DataBinding);
lbl.DataBinding+=new EventHandler(lbl_DataBinding);
if (staticText !="")
lbl.AssociatedControlID = cbx.ID;
container.Controls.Add(lbl);
container.Controls.Add(cbx);
}
I am using data grid and i want to have a checkbox as one of the column.
For that i am creating a template class and in InstantiateIn(Control
container) function i am dynamically creating a check box and adding that
check box to control collection.
Since the checkbox generates <input> tag I would like to have corresponding
label so that i can set the associatedControlID property of the label to
checkbox. But when final HTML is generated instead of <label> tag I am seeing
<span> tag.
What am i doing wrong?Please help.
Here is the code:
public void InstantiateIn(Control container)
{
CheckBox cbx = new CheckBox();
Label lbl = new Label();
cbx.DataBinding +=new EventHandler(cbx_DataBinding);
lbl.DataBinding+=new EventHandler(lbl_DataBinding);
if (staticText !="")
lbl.AssociatedControlID = cbx.ID;
container.Controls.Add(lbl);
container.Controls.Add(cbx);
}