Radio Button in C #

0

Hello, I have a registration screen and save everything ok according to the data, but when I click on the change button it returns all the registered values, but does not return the selected radio button as it was registered at the time of inclusion. p>

That is, when I click on the button change and should return radio button selected c #.

How do I do it?

if (CodTaxa > 0)
{
    objTaxa = TaxaBo.getByID(CodTaxa);
    objTaxa.DESCRICAO = txtEditDescricao.Text;
    objTaxa.TIPOVALOR = tipoValor.ToString(); //valor atribuido pelo radio button
    objTaxa.REC_DESP = operacao;//valor atribuido pelo radio button
    objTaxa.VLRPADRAO = Convert.ToDecimal(txtEditValorPadrao.Text);

    if(ValidaCampos())
    { 
        TaxaBo.Alterar(objTaxa);
    }
    else
    {
        MessageBox.Show("Algum campo precisa ser preenchido", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Warning);
        return;
    }
}
    
asked by anonymous 06.04.2017 / 21:13

1 answer

0

So you will be able to validate and be able to display the information ...

 //Radio Button Checked
        if (rbY.Checked)
        {
            Model.Tipo_Id = 1;
        }
        if (rbZ.Checked)
        {
            Model.Tipo_Id = 2;
        }

This_Id Type is where the Radio options are saved

    
10.12.2018 / 18:18