I have two radiobutton in Status.cs
panels are in class GetDataEmp.cs. GetDataEmp.cs contain two panel(panel1,panel2)one above(overlapped) the other.Panel2 is shown ,Panel 1 is hidden behind panel2.
if i click radiobutton1,panel 1 should be visible
and if i click radiobutton2,panel 2 should be visible
Now what i am doing is ,
in Status.cs
private void radiobutton1 _CheckedChanged(object sender, EventArgs e)
{
Panel panel2 = getpanel.getPanelNonProd();
Panel panel1 = getpanel.getPanelProd();
panel2.Visible = false;
panel1.Visible = true;
}
private void radiobutton2_CheckedChanged(object sender, EventArgs e)
{
Panel panel2 = getpanel.getPanelNonProd();
Panel panel1 = getpanel.getPanelProd();
panel2.Visible = true;
panel1.Visible = false;
}
Initially in design panel2 is visible.And it doesnot change on clicking radiobutton 1 or 2
What should be my approach here..>
Loading
AreebPosted Jun 30, 2010, 4:35 AM
private void radiobutton1 _CheckedChanged(object sender, EventArgs e)
{
if (radiobutton1.Checked)
{
Panel panel2 = getpanel.getPanelNonProd();
Panel panel1 = getpanel.getPanelProd();
panel2.Visible = false;
panel1.Visible = true;
}
}
private void radiobutton2_CheckedChanged(object sender, EventArgs e)
{
if (radiobutton2.Checked)
{
Panel panel2 = getpanel.getPanelNonProd();
Panel panel1 = getpanel.getPanelProd();
panel2.Visible = true;
panel1.Visible = false;
}
}
KritiPosted Jun 29, 2010, 9:59 AM
System.Windows.Forms application
Areeb QuaziPosted Jun 29, 2010, 7:58 AM
If you are doing panel2 visible true and panel2 visible false on
page load then keep these line inside if(!IsPostback) and
check autopostback property true for radio button
KritiPosted Jun 29, 2010, 7:55 AM
Its that,I want to make panel1 visible when i click radiobutton1 and panel2 when i click radiobutton2.(both panel are overlapped in GetDataEmp.cs class
Since panel are in differnt class so i have created a method to retreive the panel in Status.cs class.Once its retreived i have made it visible or invisible depending upon the choices..But thats not working for me..
I hope it makes sense..
DMR SantoshPosted Jun 29, 2010, 7:12 AM