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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top