0
I have this Radiobutton:
<asp:RadioButtonList ID="rdlCpfCnpjFornecedorBemNovo" CssClass="cPFCNPJRadioButtonList" runat="server" RepeatDirection="Horizontal" AutoPostBack="false" RepeatLayout="Flow">
<asp:ListItem Text="CPF " Value="1"></asp:ListItem>
<asp:ListItem Text="CNPJ " Value="2"></asp:ListItem>
</asp:RadioButtonList>
In the code I have this:
rdlCpfCnpjFornecedorBemNovo.SelectedValue = ventBensAquisicao.TipoPessoa.ToString();
It turns out that when the selectedvalue == 2
, he did not arrow, continues with the CPF
checked and not the CNPJ
. I tried other things besides SelectedValue
, but nothing. I need to set according to what comes from the bank, ie, 1 or 2. What is wrong that does not work?
You gave me this error: 'rdlCpfCnpjFornecedorBemNovo' has a Selectedindex which is invalid because it does not exist in the list of items. Parameter name: value
– pnet