Mark, I tried, but the .net putted the onChange on each <span> tag... see
below:.. How can I put it just on <input> tag? Thanks!
<span onchange="alert('teste');"><input
id="ctl00_Contentplaceholder2_grdContratos_ctl02_radioSimNao_0" type="radio"
name="ctl00$Contentplaceholder2$grdContratos$ctl02$radioSimNao" value="S"
/><label
for="ctl00_Contentplaceholder2_grdContratos_ctl02_radioSimNao_0">Aprovar</label></span></td><td><span
onchange="alert('teste');"><input
id="ctl00_Contentplaceholder2_grdContratos_ctl02_radioSimNao_1" type="radio"
name="ctl00$Contentplaceholder2$grdContratos$ctl02$radioSimNao" value="N"
/><label
for="ctl00_Contentplaceholder2_grdContratos_ctl02_radioSimNao_1">Rejeitar</label></span></td><td><span
onchange="alert('teste');"><input
id="ctl00_Contentplaceholder2_grdContratos_ctl02_radioSimNao_2" type="radio"
name="ctl00$Contentplaceholder2$grdContratos$ctl02$radioSimNao" value="V"
/><label
for="ctl00_Contentplaceholder2_grdContratos_ctl02_radioSimNao_2">Voltar p/
elaboração</label></span></td><td><span onchange="alert('teste');"><input
id="ctl00_Contentplaceholder2_grdContratos_ctl02_radioSimNao_3" type="radio"
name="ctl00$Contentplaceholder2$grdContratos$ctl02$radioSimNao" value="A"
checked="checked" /><label
for="ctl00_Contentplaceholder2_grdContratos_ctl02_radioSimNao_3">Não alterar
status</label></span>
Mark Rae said:
I haven't actually tried this, but I think you should be able to do
something like this:
RadioButtonList radioSimNao =
(RadioButtonList)e.Row.Cells[0].Controls[0].FindControl("radioSimNao");
foreach (ListItem li in radioSimNao.Items)
{
li.ToolTip = li.ClientID;
li.Attributes.Add("onchange", "alert('teste');");
}
What is the diference between RowCreated and RowDataBound ?
RowCreated occurs when a new row is created in the control, and
RowDataBound occurs when the data row is bound to data in the control.