That will not work. Well i suppose you already figured this out. Add it this
way instead. can't find the code... hold on
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
Label lbl = (Label)e.Item.FindControl("Dig");
if(lbl != null)
lbl.Text = "<input type=radio name='samegroup' value=" +
e.Item.Cells[1].Text + ">";
[snip]
to retrieve the selected radio button do this:
private string GetSelectedItems()
{
string retval = Request.Form["samegroup"];
if(retval == null || String.Empty == retval)
Page.Controls.Add(new LiteralControl("<script>alert('Please select a row to
dig on by enabling a radio button in the grid')</script>"));
else
retval = retval.Trim();
return retval;
}
The returned value from that function will be whatever you put in in the
value attribute of the input tag (e.Item.Cells[1].Text)
You can sorta tell that this is my current project right?
--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"George Paiva" <geo AT NO SPAM promaxim DOT com> wrote in message
news:...
> Hello,
>
> I have a datagrid that I dynamically add radio buttons to in the
> onItemDataBoud Event. I set each radio button to the same GroupName but
> when I run the page the radio button group does not dissallow multiple
> selections as it should. My C# code snippet is below.
>
> Any thoughts???
>
> public void ItemDataBoundHandler(Object sender, DataGridItemEventArgs e)
> {
> RadioButton rb = new RadioButton();
> rb.AutoPostBack=true;
> rb.GroupName="selItem";
> rb.ID=e.Item.Cells[0].Text;
> e.Item.Cells[2].Controls.Add(rb);
> }
>
>
>
> Thanks
> Geo
>
>