How do i split a line in a csv file and populate a combobox and a textbox with the parts
What I'm trying to do is split the line and fill a combobox and with the selecteditem and the textbox with the value of the combobox selecteditem which is the second part of the line split.
Thanks in advance for the help or suggestions.
Then you should create a class to represent the items in the ComboBox:
Public Class MyItem
Public Property PartA As String
Public Property PartB As String
End Class
...and add instances of this class to the ComboBox:
Try
Dim mydocpath1 As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim mylines() As String = File.ReadAllLines(mydocpath1 + "\TextFile1.txt")
For Each line In mylines
Dim parts() As String = line.Split(","c)
Dim item As MyItem = New MyItem With {.PartA = parts(0), .PartB = parts(1)}
cmb1.Items.Add(item)
Next line
cmb1.SelectedItem = cmb1.Items(1) 'select second item
Catch ex As Exception
MsgBox(ex.Message)
End Try
Then you set the DisplayMemberPath of the ComboBox to the name of one property and bind the Text property of the TextBlock to the other one:
<ComboBox Name="cmb1" DisplayMemberPath="PartA" />
<TextBlock Text="{Binding ElementName=cmb1, Path=SelectedItem.PartB}" />
That should solve your issue.
Once again, please remember to mark helpful posts as answer to close your threads and remember that a new thread deserves a new question.
Similar Messages
-
How do i read complete line from a text file in j2me?????
how do i read complete line from a text file in j2me????? I wanna read file line by line not char by char..Even i tried with readUTF of datainputstream to read word by word but i got UTFDataFormatException.. Please solve my problem.. Thanks in advance..
That is not my problem . i already read it char by char.. i am getting complete line..But this process is taking to much time..So thats why i directly wanna read complete line or word to save time..
-
I accidentally quit my CC on my Macbook pro and now the cloud icon is grayed out and every time I hover over it with the mouse I get the spinning beach ball of death on the icon. I have no idea how to open it because when I use spotlight search to open it it gives me a message saying "Creative Cloud is not open anymore" help!
Since you didn't include any pertinent info such as the Mac model and OS version you are running, here is some general information:
Mac OS X: Gray screen appears during startup
Depending on which OS yours came with originally - and which OS you are now running - you would either need your original install disks - you can call Apple for replacements by giving them your serial number. Or you may be able to reinstall the OS by using recovery (again, depends on which model/which OS). -
I created my Apple ID in Ireland, but would now like to switch to a German Apple ID, keeping the same email address. How do I delete my old Irish Apple ID, so I can create a new German one with the same email?
Welcome to the Apple Community.
Click on your account name in the top right corner of the iTunes store in the iTunes application on your computer, enter your password and click the "view account" button. Navigate to the Apple ID summary where you have the option to "change country or region".
In order to change your location, you will need a credit card registered to an address in the location you are trying to change to.
You cannot change your location if you have credit on your account, if you are unable to spend your credit and leave a balance of zero, contact Apple, which you can do through iTunes Store Support. -
I had to restore all the files on my pc using carbonite. I reinstalled iTunes and was able to find my music with the help of Apple support. How do I find my podcasts?
This helped, I restored them, but when I go to iTunes they are not there. Is there another step?
-
"Removing email account from iPhoto"
How do I remove an email account from iPhoto on an iMac? I set it up with the incorrect password and can no longer send photos, please help!To follow Larry's advice, select your email account in the list of accounts and click the "-" button to remove the account:
-
I have an app that is in my update section and it says it is not compatible with the I pad. How do I get rid of it?
Never mind, I just needed to delete the app! Which I thought I had done it was hiding right in front of my face!
-
I am new to this I Pad Air and was downloading games and is still showing in waiting mode with the circle continually going Arian. I want to delete but unable to figure ot how. also needing to delete history, need a lot of help
Hey Carolyn1951,
Thanks for the question. I understand you have a few apps that only display "Waiting". The following is a past discussion that dealt with a similar issue, the answer may help you as well:
App updates won't download on my...: Apple Support Communities
https://discussions.apple.com/thread/4111336
Try tapping the App, so that it changes to Paused instead of Waiting, then tap it again to resume the install.
Make sure you don't have any paused downloads in other apps either, like the App Store or iTunes Store.
If that doesn't do it, try resetting or restoring the iPhone.
via whatheck
Thanks,
Matt M. -
I am running Yosemite and have just bought Pro Tools Express with the intent to Upgrade to Pro Tools 11. Pro Tools Express is not compatible with Yosemite and will not install. How can I get this done?
I have had this problem for close to a year. I have an Extreme base station, two Airport Express's and multiple G4 Mac's with up to date software. I have spent a huge amount of time trouble shooting, resetting, reapplying software and finally calling Applecare without any help. It would be great to get this problem solved.
Powerbook G4 Mac OS X (10.4.7) -
PS CC 2014 DNG and RAW 8.5 did not update with the rest of the CC package. I downloaded/installed the DNG/RAW converter but how do you install w/i CC 2014 plugins
Thanks John. I have tried solutions 1 to 3 from (-http://helpx.adobe.com/creative-cloud/kb/aam-lists-removed-apps-date.h tml) and they do not work. So I presume that all I can do is to remove all 25 CC applications and start again!
Incidently, ( http://www.adobe.com/downloads/updates/ ) does not list Adobe Camera Raw 8.4 as an update even though Adobe have announced that it is available (http://blogs.adobe.com/lightroomjournal/2014/04/camera-raw-8-4-and-dng-converter-8-4-now-a vailable.html). The same applies for Adobe Premiere Pro 7.2.2 (http://blogs.adobe.com/premierepro/2014/04/premiere-pro-cc-7-2-2.html). If they are not available this would explain why I cannot download them but I am very suprised that Adobe didn't mention this when I contacted them.
Anyway thanks again -
how can I get authentication and authorization through OS X open directory with the Sun ZFS STOR ZS3-2
I have configure NFS, I need help configuring the share that I created in the Sun ZFS STOR ZS3-2 to connect with the OS X Open DirectoryHi,
You may try checking the help page for ldap configuration :
https://<Appliance_IP>:215/wiki/index.php/Configuration:Services:LDAP
ZFS Storage supports LDAP, NIS, AD as directory service.
Hope Open Directory is also based on LDAP and may work in similar fashion.
Thanks
Nitin -
Hi, I rented a movie off iTunes but the there is no sound. I've bought and rented previous movies and I've never had any problems with the sound before. Is this some kind of glitch? How can I get my money back?
Hey grossa2,
First, here is a way to report an issue with your purchase:
How to report an issue with your iTunes Store, App Store, Mac App Store, or iBooks Store purchase
http://support.apple.com/kb/HT1933
Then, I'd go through this article, which helps troubleshoot a lack of audio playback in iTunes:
iTunes and QuickTime for Windows: Audio does not play or plays incorrectly
http://support.apple.com/kb/TS1362
Take care,
Delgadoh -
How to authorise more than one machine (1 tablet Android and one PC running Windows XP Pro) with the same Adobe ID ?
Cloud License allows 2 activations http://www.adobe.com/legal/licenses-terms.html
-Install on a 2nd computer http://forums.adobe.com/thread/1452292?tstart=0
-Windows or Mac does not matter... 2 on the same operating system, or 1 on each -
I had a new phone and I clicked some pictures and then I restore my new phone with the old back up and I lost my new clicked photos...please help me how can I get back those photos?
You were already provided the answer. If you do not have a backup of the phone while the photos were on the phone, they are gone. When you restore your phone from an old backup, anything that has been saved to the phone since that backup is deleted. Sorry.
-
I tried to install the new iOs 7 on my iphone5 and itunes shut down before it completed and now my phone is stuck on with the apple and a line under it.
Hello roch23
Check out the article below to get you back up in running.
iOS: Unable to update or restore
http://support.apple.com/kb/HT1808
Thanks for using Apple Support Communities.
Regards,
-Norm G.
Maybe you are looking for
-
Hey guys, I got some questions on room state: 1) Does the room state actually take some effect or just an indicating flag? For example, if a room state is ROOM_STATE_ENDED, will it prevent any incoming user connection? 2) I tried to lo
-
Is it possible to control an itunes library located on an iMAC from a
I am trying to set up a sound system for a blind person using an ipad as a controller. The itunes music library is located on a iMAC and there is a Wifi network with an Airport Express located elsewhere. The ipad has the Remote App and Airport utili
-
Linking multiple sheets?
Greetings, I have a Numbers 09 workbook with multiple (40) sheets that I would like to be able to link to a summery sheet. The cell on the summery sheet would sum all of the data from the same cell in all other 40 sheets as it is changed. I was able
-
I am displaying the table in ALV Grid format. I have 4 fields in the table. The filter works for the first 3 fields, but doesnot work for the last field. Please let me know what might be the issue. Find the table declaration and the table population
-
Mac book pro and bigpond email (australia)
i just got my macbook back as the hard drive decided it did not want to work anymore. since then i have attempted to set up my email account and it just does not work, only one that works is my iCloud email. i would really appreciate some assistance