Error receiving Picker content

0

I have a client registry and I need to change the registry of a client at some point, but to make the change I have to deal with a Picker field, only it gives an error when I try to bring the content that is written to it soon after, if change.

The error:

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

Picker code (with other fields to give a 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 content, they are ready to be changed.

    
asked by anonymous 24.04.2018 / 22:46

1 answer

0

I was looking for a way to change the internet and I did it. Actually I'm getting to know the tools and I understood that I needed the SelectedItem (get the content) and not the SelectedIndex (not index), so I took the Convert and it was:

pckUF.SelectedItem  = clienteAlterar.UF;

But thank you for the feedback @Diego.

    
24.04.2018 / 22:59