Private Sub Grid_RowDataBound(sender As [Object], e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim group As Group = DirectCast(e.Row.DataItem, Group)
Dim holder As PlaceHolder = DirectCast(e.Row.FindControl("_holder"), PlaceHolder)
Dim innerhtml As [String] = [String].Format("<input type='radio' name='sample' value='{0}'>", group.Id)
holder.Controls.Add(TemplateControl.ParseControl(innerhtml))
End If
End Sub
Code (C#)
private void Grid_RowDataBound( Object sender, GridViewRowEventArgs e )
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Group group = (Group)e.Row.DataItem;
PlaceHolder holder = (PlaceHolder)e.Row.FindControl("_holder");
String innerhtml = String.Format("<input type='radio' name='sample' value='{0}'>", group.Id);
holder.Controls.Add(TemplateControl.ParseControl(innerhtml));
}
}