private void radAutoCompleteBox_Leave(object sender, EventArgs e) { if (autoList.Count > 0) { //var t = radAutoCompleteBox.Text.ToString(); var item = autoList.FirstOrDefault(); if (item != null) { var placeid = item.placeid; if (!string.IsNullOrEmpty(placeid)) { var details = GoogleApi.get_place_details(placeid); if (details != null) { StrNum.ResetText(); StrAddress.ResetText(); City.ResetText(); State.ResetText(); ZipCode.ResetText(); Country.ResetText(); StrNum.Text = details.StreetNumber; StrAddress.Text = details.Route; City.Text = details.City; State.Text = details.State; ZipCode.Text = details.Zipcode; Country.Text = details.Country; } } } } }
private void ListBox_MouseClickSelectedItem(object sender, MouseEventArgs e) { //Console.WriteLine(AutoComplete.SelectedItem); var auto = (AutoComplete)AutoComplete.SelectedItem; if (auto == null && AutoComplete.PreviousSelectedItem != null) { auto = (AutoComplete)AutoComplete.PreviousSelectedItem; } if (auto != null) { var placeid = auto.placeid; if (!string.IsNullOrEmpty(placeid)) { var details = GoogleApi.get_place_details(placeid); if (details != null) { StrNum.Text = details.StreetNumber; StrAddress.Text = details.Route; City.Text = details.City; State.Text = details.State; ZipCode.Text = details.Zipcode; Country.Text = details.Country; } } } }