| | |
Hidden column in ListBox
![]() |
•
•
Join Date: Aug 2009
Posts: 51
Reputation:
Solved Threads: 0
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...
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...
•
•
Join Date: Aug 2009
Posts: 51
Reputation:
Solved Threads: 0
0
#2 Oct 30th, 2009
ok, i did it finally, like that:
VB.NET Syntax (Toggle Plain Text)
ClanarinaListBox.DataSource = dataTableFee ClanarinaListBox.DisplayMember = "Everything" ClanarinaListBox.ValueMember = "ID"
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: Query by date
- Next Thread: VB.Net 2005 PrintPreviewDialog Limitations
Views: 316 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net 2005 2008 access ado.net application array arrays basic bindingsource browser c# center checkbox client code combobox communication connection control convert crystal crystalreport data database datagrid datagridkeyevents datagridview dataset datatable date datetimepicker design designer dissertation dissertations error excel file form gridview image images insert listview login loops mobile ms msaccess net objects openxml path port print printing problem read save search security serial server settings sms sms-notification socket sorting sql statement studio syntax tagging tags text-parser textbox time timer type update upload user validation vb vb.net vb2008 view visual visual-studio visualbasic visualbasic.net visualstudio2008 vs2008 web webbrowser windows winforms wpf xml





