5 Replies - 513 Views - Last Post: 17 February 2017 - 08:04 AM Rate Topic: -----

#1 cipcip   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 16-February 17

Get value from combobox into listbox

Posted 17 February 2017 - 06:02 AM

Hello fellow programmers.

I am new at all the Visual Studio, C# programming, I come from the land of PHP and wanted to learn this side as well :)
What I am getting stuck at and need your help is the following scenario:

Lets say I have a combobox with the values A, B and C.
When I select A, I want in the listbox below to appear the information from A.csv, when I select B, B.csv and so on.
I found a tutorial on how to read csv files and it doesn't appear to be that hard, but I do not know how to connect these two.

Any help will be appreciated.
Thank you very much.

Is This A Good Question/Topic? 0
  • +

Replies To: Get value from combobox into listbox

#2 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7056
  • View blog
  • Posts: 23,989
  • Joined: 05-May 12

Re: Get value from combobox into listbox

Posted 17 February 2017 - 06:42 AM

What book or tutorial about C# are you currently using? They should have introduced the concept of event driven programming. In this case you simply wait for the event notification about the selected item having changed.
Was This Post Helpful? 0
  • +
  • -

#3 cipcip   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 16-February 17

Re: Get value from combobox into listbox

Posted 17 February 2017 - 06:45 AM

This is the one I have: http://www.goodreads..._How_to_Program
I will look more closely, but I can't seem to remember reading about it.
Was This Post Helpful? 0
  • +
  • -

#4 cipcip   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 16-February 17

Re: Get value from combobox into listbox

Posted 17 February 2017 - 07:48 AM

I also watched this tutorial for xml and I saw the selected item changed option but I am not sure at that point how to tell it to take the information from the .csv file.
https://www.youtube....h?v=ulzFqXb13dI
Was This Post Helpful? 0
  • +
  • -

#5 andrewsw   User is offline

  • never lube your breaks
  • member icon

Reputation: 6818
  • View blog
  • Posts: 28,229
  • Joined: 12-December 12

Re: Get value from combobox into listbox

Posted 17 February 2017 - 07:56 AM

There are essentially two parts. Read the value from the ComboBox, constructing a filename from it, and read the data from the CSV. You can find plenty of tutorials about reading from a CSV file.

Or are you striving to find a tutorial that does exactly what you want? That is unlikely or, at least, hard to find.
Was This Post Helpful? 1
  • +
  • -

#6 cipcip   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 16-February 17

Re: Get value from combobox into listbox

Posted 17 February 2017 - 08:04 AM

I found something similar to what I am looking for after couple of days of searching ( just found it ). Will see if I can implement it properly :)

http://stackoverflow...ction-csv-array

If I run into trouble I know I can count on you guys :)
Thank you very much.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1