|
-
Dec 10th, 2006, 11:06 PM
#1
Thread Starter
Lively Member
[2005] Want to display 2 columns in combobox
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.
-
Dec 10th, 2006, 11:30 PM
#2
Re: [2005] Want to display 2 columns in combobox
This is written in VB.NET. This is written in C# but I think that it may be better. If you Google for multicolumn combobox ".net" you will find others too. Who'd have thought?
-
Dec 11th, 2006, 10:47 AM
#3
Re: [2005] Want to display 2 columns in combobox
 Originally Posted by rim78
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,
Here's a link how to create a multicolumn combobox;
http://www.codeproject.com/vb/net/Mu...nFlatCombo.asp
Hope it helps,
sparrow1
-
Dec 11th, 2006, 11:28 PM
#4
Thread Starter
Lively Member
Re: [2005] Want to display 2 columns in combobox
Thank you very much for the links! I'll implement it right away.
-
Dec 13th, 2006, 10:29 PM
#5
Thread Starter
Lively Member
Re: [2005] Want to display 2 columns in combobox
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|