Programmatically select a radio button contained in a gridview row

S

Smith

The radio buttion was added to the gridview like this:

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));
}
}


Now, when my page loads, based on a session field which hold the index of a
previously selected row, i need to
check the radio button inside the selected row.
Grid.SlectedIndex = Convert.ToInt32(Session["gview_selectedindex"]) does
select the row.

Now i need to check the radio button inside.


Does anyone have an idea how to accomplish this?

Cheers
S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top