views:

20

answers:

1

I have an application such that my fields are binded with gridview among those i will have a fieldname likely Renewed this may be Yes/No in my table. When i bind my values i would like show a radiobutton in a grid like i will have 2 radio boxes at that field namely Yes or no. If in my database field if it is saved as No i would like to show the user with No radio button as selected and if yes i would like to show the alternative

+1  A: 

you need to use gridview rowdatabound event

protected void yourGrid_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        RadioButton rdb= e.Row.FindControl("yourRadioButton") as RadioButton;
        rdb// set here 
    }
}
Muhammad Akhtar
How can i set it as checked for No and Yes can u please tell
Dorababu