Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I load all of data from the database into a List then display all in a ListBox.

games_listBox.DataSource = _games;

All games have a data: year of publication, year of manufacture, name, manufacturer, category.

The question:

How to display only the "year of publication" and the "name" in a separeted textboxes when selected an item in the listbox?

What I have tried:

string name = games_listBox.GetItemText(games_listBox.SelectedItem);
name_textBox.Text = name;
Posted
Updated 4-Dec-22 6:43am

1 solution

Take a look at A Detailed Data Binding Tutorial[^] which shows a number of ways to do it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900