WPF: C# How to get selected value of Listbox?

前端 未结 5 1738
忘掉有多难
忘掉有多难 2021-01-27 17:00

I am trying to fetch the selected value of the listbox. When I actually try LstGroup1.SelectedItem I get the value { BoothID = \"4\", BoothName = \"HP\" }

5条回答
  •  -上瘾入骨i
    2021-01-27 17:12

    Have you tried :

    var Booth = (LstGroup1.SelectedItem);
    string ID=Booth.BoothID;
    string Name=Booth.BoothName:
    

提交回复
热议问题