Home » FAQ » ASP.NET » ListBox » How to select a specific Item in a ListBox in code
VB.NET
ListBox1.Items.FindByValue(<Value>).Selected = true ’ListBox1.Items.FindByText(<Text>).Selected = true
C#
ListBox1.Items.FindByValue(<Value>).Selected = true; //ListBox1.Items.FindByText(<Text>).Selected = true;
Platform BlazorASP.NETWinFormsWPF.NET MAUI
Question *
Answer (Optional)
Email (Optional)
Email address is only for further clarification on your FAQ request. It will not be used for any other purpose.
Please leave this field empty.
Share with