Hidden column in ListBox

Reply

Join Date: Aug 2009
Posts: 51
Reputation: Peric is an unknown quantity at this point 
Solved Threads: 0
Peric Peric is offline Offline
Junior Poster in Training

Hidden column in ListBox

 
-1
  #1
Oct 30th, 2009
Ok, this is what I need...
I select four columns(those are informations about payed fee for each member...so it could have zero or more rows) from my database (from two different tables), one record as "ID" and other three (i've band them together) as "Rest".
Then, I've put that column "Rest" as a DisplayMember for my first ListBox...because I couldn't find a solution to put that "ID" column in the same ListBox, and make it invisible for user (I need "ID" column for accessing those fields about payed fee) I've made another ListBox and set DisplayMember = "ID". I've put that ListBox on Visible=False and when I select rows from first ListBox "ID" is also changing and on event "SelectedIndexChange" for first ListBox I'm trying to get this "ID", store it into Integer variable and then put it into another select query that will select only selected pay fee from database...everything of this works fine but when I try to put that data from the last select query (something like this: TextBox3.Text = dataTablePodaci.Rows(0).Item(1) ) to a different textboxes (because there are three columns in select) here comes the problem, suddenly. The thing is that I can't see my real records in the main ListBox anymore...and instead of that for all rows I get: "System.Data.DataRowView". Yes, and also...everything in the back works ok...when I select each "System.Data.DataRowView" row, I see that my ID is changing and also my select is working fine and values I select are also changing...so everything works instead that first/main Listbox got himself confused somehow.

Any ideas? Does anyone know if listbox is having some kind of ability to hide column, to put "ID" for each record of something?
I've tried to do this with DataGridView also but I had some problems (with date) so I've tried with ListBox...
Reply With Quote Quick reply to this message  
Join Date: Aug 2009
Posts: 51
Reputation: Peric is an unknown quantity at this point 
Solved Threads: 0
Peric Peric is offline Offline
Junior Poster in Training
 
0
  #2
Oct 30th, 2009
ok, i did it finally, like that:

  1. ClanarinaListBox.DataSource = dataTableFee
  2. ClanarinaListBox.DisplayMember = "Everything"
  3. ClanarinaListBox.ValueMember = "ID"
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the VB.NET Forum


Views: 316 | Replies: 1
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC