I have many controls in same gridview cell. I am using the following code. But i want them to be displayed vertically instead of horizontally, because with the following code it assigns them in the same line. Any help?
RadioButton rd1 = new RadioButton();
rd1.Text = "Test1";
RadioButton rd2 = new RadioButton();
rd2.Text = "Test2";
grdRSM.Rows[0].Cells[2].Controls.Add(rd1);
grdRSM.Rows[0].Cells[2].Controls.Add(rd2);
You could do two thing
First
Use
RadioButtonListinstead of singleRadioButtonand set it’sRepeatDirection="Vertical"Second
Use
HtmlGenericControlto render aBRsomething like thisIt would make those
RadioButtonsto be rendered vertically