Hi,
I am new to C#. I am just learning. I am struck with a problem. I have created a usercontrol with dynamic table with radiobuttons. Now I don't know how to
handle the event radioButton_SelectedIndexChanged.
This is a part of my code. Please help me.
Table InnerTable=new Table();
InnerTable.BorderWidth=0;
cellForInnerTable.Controls.Add(InnerTable);
if(strMainOuter.Length>1)
{
string strSubInner=strMainOuter[1];
string[] strSubHeading=strSubInner.Split(new char[] {'#'});
foreach(string strsubOption in strSubHeading)
{
TableRow tableRowsubOption=new TableRow();
TableCell RadioCell=new TableCell();
RadioButton radioButton=new RadioButton();
radioButton=new RadioButton();
radioButton.GroupName="Group" + strMainChk;
radioButton.ID="rdo" + strsubOption;
radioButton.Text=strsubOption;
radioButton.AutoPostBack=true;
RadioCell.Controls.Add(radioButton);
tableRowsubOption.Cells.Add(RadioCell);
InnerTable.Rows.Add(tableRowsubOption);
}
}
Please help me
thanks in advance
tondarb
I am new to C#. I am just learning. I am struck with a problem. I have created a usercontrol with dynamic table with radiobuttons. Now I don't know how to
handle the event radioButton_SelectedIndexChanged.
This is a part of my code. Please help me.
Table InnerTable=new Table();
InnerTable.BorderWidth=0;
cellForInnerTable.Controls.Add(InnerTable);
if(strMainOuter.Length>1)
{
string strSubInner=strMainOuter[1];
string[] strSubHeading=strSubInner.Split(new char[] {'#'});
foreach(string strsubOption in strSubHeading)
{
TableRow tableRowsubOption=new TableRow();
TableCell RadioCell=new TableCell();
RadioButton radioButton=new RadioButton();
radioButton=new RadioButton();
radioButton.GroupName="Group" + strMainChk;
radioButton.ID="rdo" + strsubOption;
radioButton.Text=strsubOption;
radioButton.AutoPostBack=true;
RadioCell.Controls.Add(radioButton);
tableRowsubOption.Cells.Add(RadioCell);
InnerTable.Rows.Add(tableRowsubOption);
}
}
Please help me
thanks in advance
tondarb