StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
WinForms (How do I?)
»
combobox-question
combobox-question
Post Reply
Like
3
combobox-question
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Thomas Holste
Thomas Holste
posted 11 Years Ago
ANSWER
Topic Details
Share Topic
Group: StrataFrame Users
Posts: 144,
Visits: 618
Hi there,
is it possible to fill the dropdown-list of a multi-column combobox manually? And how has this to be done?
Thanks in Advance
Thomas
Reply
Like
3
Replies
StrataFrame Team
S
StrataFrame Team
posted 11 Years Ago
ANSWER
Post Details
Share Post
S
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
Howdy Thomas,
Yes, you can use the MultiColumns and populate manually, but you still have to use the .NET-style data source for the combo box. Basically, you have to have a list behind the combo box that defines the items, and the easiest way to do this is with a DataTable, but you can just as easily create a custom class with a few properties and use a generic list with a BindingSource, but the DataTable already has all of those interfaces on it.
Create a DataTable with 3 columns, "Display" (string), "Value" (object), and "DropDown" (string).
Populate it with rows for the items you want in the combo box
The value in the Display column will show as the selected item when the combo box is closed
The value in the Value column will be the SelectedValue on the combo box for binding
The value in the DropDown column will be what is used to render the drop down. Combine all of the columns into this field and pipe delimit them: "Column 1|Column 2|Column 3" The pipes are used to split the columns when rendering the drop down.
Set the UseMultiColumns to true
Set DropDownMember to "DropDown"
Set DisplayMember to "Display"
Set ValueMember to "Value"
Set the DataSource property to your data table.
That should do it. Anything you put into the DataTable gets added as a row in the combobox.
Reply
Like
3
Thomas Holste
Thomas Holste
posted 11 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Users
Posts: 144,
Visits: 618
Hi Ben,
thanks for the explanation, I will try it immediately.
Best regards
Thomas
Reply
Like
3
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
combobox-question
Thomas Holste
-
11 Years Ago
Hi Thomas, I have never had the need to manually populate a comobox,...
Edhy Rijo
-
11 Years Ago
Hi Edhy, thanks for your reply. I use the combobox already with using...
Thomas Holste
-
11 Years Ago
Howdy Thomas, Yes, you can use the MultiColumns and populate...
StrataFrame Team
-
11 Years Ago
Hi Ben, thanks for the explanation, I will try it immediately. Best...
Thomas Holste
-
11 Years Ago
Post Reply
Like
3
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search