Hello,
Now here picker showing course name but its not generating correct key when i click button
You need to get the selectitem by myData[selectedIndex]
in the MainPicker_SelectedIndexChanged
, then you can get the key from the selectitem like following code.
private void MainPicker_SelectedIndexChanged(object sender, EventArgs e)
{
var picker = (Picker)sender;
int selectedIndex = picker.SelectedIndex;
if (selectedIndex != -1)
{
Courses result = myData[selectedIndex];
string keyValue=result.Key;
}
}
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.