Radio buttons will not work by default inside a datagrid. The selection will be individual, because the groupname/id of the control is going to be different for each role automatically. Hence we need to make use of the literal control.
1. Insert literal control instead of the radiobutton control into the datagrid
2. The idea is to find the literal control inside the datagrid
3. Replace it with a radio button control with a fix name.
Something like:
if (e.Row.RowType == DataControlRowType.DataRow)
{
Literal literal = (Literal) e.Row.FindControl("RadioButtonMarkup");
literal.Text = String.Format("<input type='radio' name='couponId' id='coupon{0}' value='{0}' />", e.Row.RowIndex);
}
Saturday, August 22, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment