combobox-question


Author
Message
Thomas Holste
Thomas Holste
StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)
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
Edhy Rijo
E
StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Thomas,

I have never had the need to manually populate a comobox, but it is doable.  Based on the SF help file "List Control Population" you need to follow the examples in the Microsoft's .NET Developers Guide.

Now back to your question, do you really need to populate the list manually or will you be using any of the SF sources?   Be aware that you can show multiple columns with SF population events.

Edhy Rijo

Thomas Holste
Thomas Holste
StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Edhy,

thanks for your reply. I use the combobox already with using the VO-populationtypwe. But there are two reasons ti add items manually

. The dropdown-items are generated dynamically and

- I have encountered some problems with combo-boxes populated by a BO (This will be a new topic)

Populating a combobox is not a problem, but I was curious if I can populate a sf-combobox with a multiline dropdown-list.

Best regards

Thomas
StrataFrame Team
S
StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)
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.

  1. Create a DataTable with 3 columns, "Display" (string), "Value" (object), and "DropDown" (string).  
  2. Populate it with rows for the items you want in the combo box
    1. The value in the Display column will show as the selected item when the combo box is closed
    2. The value in the Value column will be the SelectedValue on the combo box for binding
    3. 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.
  3. Set the UseMultiColumns to true
  4. Set DropDownMember to "DropDown"
  5. Set DisplayMember to "Display" 
  6. Set ValueMember to "Value"
  7. 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.
Thomas Holste
Thomas Holste
StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)StrataFrame User (294 reputation)
Group: StrataFrame Users
Posts: 144, Visits: 618
Hi Ben,

thanks for the explanation, I will try it immediately.

Best regards

Thomas
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search