Hello all and good morning.
I was wondering how to make the combobox to display 2 columns, e.g: code and description when the user click to drop down, like in MS Access. the code is stored in table.
Thanx.
Printable View
Hello all and good morning.
I was wondering how to make the combobox to display 2 columns, e.g: code and description when the user click to drop down, like in MS Access. the code is stored in table.
Thanx.
Hi,Quote:
Originally Posted by rim78
Here's a link how to create a multicolumn combobox;
http://www.codeproject.com/vb/net/Mu...nFlatCombo.asp
Hope it helps,
sparrow1
Thank you very much for the links! I'll implement it right away. :)
Finally I got the chance to try out some of your links. Also did search on Google and found a few interesting ones. :)
But I'm more into creating a multiple column combobox that supports databinding. Found one here:
Multi-column combo
But I'm not sure whether I've implemented it correctly or not. I added a MultiColumn Combo item in Toolbox using the dll file it provided. I also add a MulColCombo reference in the project.
I dragged the control into my form that is already has a databinding, TestSaveSourceDataSet.
Now my multicolumn combobox binds to another dataset, Me.StockDataSet.Tables("SOURCETABLE")
to display 2 columns, SCODE and DESC.
What I can't seem to workout is how to save the row that I've chosen in the combobox to another, TestSaveSourceDataSet .
In the multicolumn bombo control, there are a 'Text' property, which, described in the page, "In this property, the selected item will be stores."
Now, how do I get the combobox to store the SCODE into my TestSaveSource table?
TIA.
VB Code:
Private Sub MultipleColmCombo2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try 'Form binds to this dataset Me.TestSaveSourceTableAdapter.Fill(Me.TestSaveSource_DataSet.TestSaveSource) 'Multicolumn combobox binds to this dataset Me.SOURCETABLETableAdapter.Fill(Me.StockDataSet.SOURCETABLE) 'Load multicolumn combo MultiColumnCombo1.DataSource = Me.StockDataSet.Tables("SOURCETABLE") MultiColumnCombo1.LoadData() Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub