protected System.Web.UI.WebControls.RadioButtonList RadioButtonList1;
/*This bit is from the page load event which dynamically builds each button
for each row*/
foreach (System.Data.DataRow r in dsTalks1.Tables[0].Rows)
{//Do not want to show the video id in dataset so start index at 1
sb.Append("Talk ID:" + r.ItemArray[1].ToString() + ", ");
sb.Append(r.ItemArray[2].ToString() + ", ");
sb.Append(r.ItemArray[3].ToString() + ", ");
sb.Append(r.ItemArray[4].ToString());
this.RadioButtonList1.Items.Add(sb.ToString());
this.RadioButtonList1.Items[0].Selected = true;
//Clear string builder for next cycle
sb.Remove(0, sb.Length);}
/*And this bit is from my button click event handler which should find the
selected radiobutton - but always returns the first item*/
while (this.RadioButtonList1.Items[talkselected].Selected != true)
{talkselected ++;}
//Change videoid in the dataset
System.Data.DataRow row = this.dsTalks1.Tables[0].Rows[talkselected];
"Mark Sandfox" <No****@NoSpam.com> wrote in message
news:kK****************@newssvr31.news.prodigy.com ...
Post your code please. I think you simply have a delcaration problem.
"Mark Broadbent" <no****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl... try as I might (and using different properties) this control always seems
to be returning the first element of the control as the "selected" item
even though I am selecting the second element. All I need it the index
number to reference a particular row num of a dataset. I only just
noticed this today but it if I cant determine the selected
radiobuttonlist item then it reders this control useless.
Hope someone can help?
--
Br,
Mark Broadbent
Mark Broadbent
mcad, mcdba , mcse+i