I am trying to get the value of the selected item in the listbox using the code below, but it is always returning null string.
DataSet ds = searchforPrice(Co
The correct solution seems to be:
string text = ((ListBoxItem)ListBox1.SelectedItem).Content.ToString();
Please be sure to use .Content and not .Name.