Exemplo n.º 1
0
    //to set the panels and controls to be disabled based on the radio button selected
    void setPanelStatus()
    {
        //for 9th grade issue;
        string strGrade = "";

        strGrade = GetGrade();

        if ((strGrade == "9") && RadioBtnQ3.SelectedValue == "2")
        {
            pnl9grade.Enabled = false;
            RadioBtnQ3.ControlStyle.ForeColor = System.Drawing.ColorTranslator.FromHtml("#848284");
            Label5.ControlStyle.ForeColor     = System.Drawing.ColorTranslator.FromHtml("#848284");
            ListItemCollection Q4Options;
            ListItem           Option3;
            Q4Options       = RadioBtnQ4.Items;
            Option3         = Q4Options.FindByValue("3");
            Option3.Enabled = false;
        }
        else
        {
            pnl9grade.Enabled = true;
            RadioBtnQ3.ControlStyle.ForeColor = System.Drawing.ColorTranslator.FromHtml("#0");
            Label5.ControlStyle.ForeColor     = System.Drawing.ColorTranslator.FromHtml("#0");
            ListItemCollection Q4Options;
            ListItem           Option3;
            Q4Options       = RadioBtnQ4.Items;
            Option3         = Q4Options.FindByValue("3");
            Option3.Enabled = true;
        }

        //for Question 3 & 4
        if (RadioBtnQ3.SelectedIndex.Equals(0))   //yes is selected
        {
            PnlQ4.Enabled            = false;
            RadioBtnQ4.SelectedIndex = -1;
            //PnlQ5.Enabled = false;
            //txtYear.Text = "";
            //txtNoofDays.Text = "";
        }
        else if (RadioBtnQ3.SelectedIndex.Equals(1)) //No is selected
        {
            if (RadioBtnQ4.SelectedIndex.Equals(2))  //"I did not receive an incentive" is selected
            {
                //PnlQ5.Enabled = true;
                //txtYear.Focus();
            }
            else if (RadioBtnQ4.SelectedIndex.Equals(1) || RadioBtnQ4.SelectedIndex.Equals(0)) //Option 1 or 2 is selected
            {
                PnlQ4.Enabled = true;
                //PnlQ5.Enabled = false;
                //txtYear.Text = "";
                //txtNoofDays.Text = "";
            }
            else  //radiobtnq4 is not selected
            {
                PnlQ4.Enabled = true;
                //PnlQ5.Enabled = true;
                //txtYear.Text = "";
                //txtNoofDays.Text = "";
            }
        }
    }
Exemplo n.º 2
0
    //to set the panels and controls to be disabled based on the radio button selected
    void setPanelStatus()
    {
        //for 9th grade issue;
        string strGrade = "";

        strGrade = GetGrade();

        if ((strGrade == "9") && RadioBtnQ3.SelectedValue == "2")
        {
            pnl9grade.Enabled = false;
            RadioBtnQ3.ControlStyle.ForeColor = System.Drawing.ColorTranslator.FromHtml("#848284");
            Label5.ControlStyle.ForeColor     = System.Drawing.ColorTranslator.FromHtml("#848284");
            ListItemCollection Q4Options;
            ListItem           Option3;
            Q4Options       = RadioBtnQ4.Items;
            Option3         = Q4Options.FindByValue("3");
            Option3.Enabled = false;
        }
        else
        {
            pnl9grade.Enabled = true;
            RadioBtnQ3.ControlStyle.ForeColor = System.Drawing.ColorTranslator.FromHtml("#0");
            Label5.ControlStyle.ForeColor     = System.Drawing.ColorTranslator.FromHtml("#0");
            ListItemCollection Q4Options;
            ListItem           Option3;
            Q4Options       = RadioBtnQ4.Items;
            Option3         = Q4Options.FindByValue("3");
            Option3.Enabled = true;
        }

        //for Question 3 & 4
        if (RadioBtnQ3.SelectedIndex.Equals(0))   //yes is selected
        {
            PnlQ4.Enabled            = false;
            RadioBtnQ4.SelectedIndex = -1;

            //pnlq5 will always be disabled
            //PnlQ5.Enabled = false;
            //txtYear.Text = "";
            //txtNoofDays.Text = "";

            //added logic to force disabled color for Firefox:  LMU...11/21/2008
            //remove the following code if Q5 ever becomes active
            //PnlQ5.ControlStyle.ForeColor = System.Drawing.ColorTranslator.FromHtml("#848284");
        }
        else if (RadioBtnQ3.SelectedIndex.Equals(1)) //No is selected
        {
            if (RadioBtnQ4.SelectedIndex.Equals(2))  //"I did not receive an incentive" is selected
            {
                //PnlQ5.Enabled = true;
                //txtYear.Focus();
            }
            else if (RadioBtnQ4.SelectedIndex.Equals(1) || RadioBtnQ4.SelectedIndex.Equals(0)) //Option 1 or 2 is selected
            {
                PnlQ4.Enabled = true;
                //PnlQ5.Enabled = false;
                //txtYear.Text = "";
                //txtNoofDays.Text = "";
            }
            else  //radiobtnq4 is not selected
            {
                PnlQ4.Enabled = true;
                //PnlQ5.Enabled = true;
                //txtYear.Text = "";
                //txtNoofDays.Text = "";
            }
        }

        //added logic to force disabled color for Firefox:  LMU...11/21/2008
        if (PnlQ4.Enabled)
        {
            RadioBtnQ4.ControlStyle.ForeColor = System.Drawing.ColorTranslator.FromHtml("#0");
            lblQ4.ControlStyle.ForeColor      = System.Drawing.ColorTranslator.FromHtml("#0");
        }
        else
        {
            RadioBtnQ4.ControlStyle.ForeColor = System.Drawing.ColorTranslator.FromHtml("#848284");
            lblQ4.ControlStyle.ForeColor      = System.Drawing.ColorTranslator.FromHtml("#848284");
        }
    }