Error while receiving Picker content

Asked

Viewed 25 times

1

I have a client register and I need to change the registration of the same at some point, but to make the change I have to deal with a Picker field, only it is a mistake when I try to bring the content that is recorded in it to soon after, if necessary, change.

The mistake:

"Unhandled Exception: System.Formatexception: Input string was not in a correct format."

Picker code (with other fields for better example):

pckUF.SelectedIndex = Convert.ToInt32(clienteAlterar.UF);
entryIBGE.Text      = clienteAlterar.COD_IBGE;
entryTel1.Text      = clienteAlterar.FONE1;

Note: If I remove the Picker from my code (in this part of Change) all fields normally receive their contents, they are ready to be changed.

  • 1

    clienteAlterar.UF is a string with valid numeric content? This is what validation is claiming

1 answer

1


I was looking for a way to change it online, and I did. Actually I’m getting to know the tools and I understood that I was needing Selecteditem (get the content) and not Selectedindex (not index), so I took Convert and went:

pckUF.SelectedItem  = clienteAlterar.UF;

But thanks for the feedback @Diego.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.