Why move
Existing Infragistics subscriptions can still be renewed, and Ultimate UI for Windows Forms is still being released. What changed is how you get a new license: a new developer on the team, or a new project, now needs a suite license, even when the application uses only a few Windows Forms controls. If those controls are a multi-column dropdown, a tree, masked and date fields and tabs, our five .NET controls cover them, sold separately or together. See moving from Infragistics Windows Forms for all five.
What you get
SftBox/NET 3.0 is a combo box control for Windows Forms, written entirely in C# and shipped as a single assembly.
- One control for both. Bind it to data like an UltraCombo, or fill it from code like an UltraComboEditor, with the same columns, headers and search either way.
- Hierarchical dropdowns from your data. A key and a parent member, or a children member, turn a list into a tree inside the dropdown, with items that expand and collapse, and a filter that keeps the parents of the items it finds.
- Search that finds what users type. Autocomplete, a search anywhere in the text or a filter that narrows the list as the user types, in any column, with the dropdown opening on typing or on focus if you want.
- Rich items. Images, color samples, check boxes, progress bars, multi-line text and items of different heights in the list, and font lists filled by the control.
- The selection shown in full. A DropDownList field can show the selected item with all of its columns and images, and the Simple style keeps the list always open below the field.
- Control over the dropdown. Width fitted to the columns or to the field, height in whole items, alignment, position, hot tracking and a resizing grip.
- Modern Windows. The same API and Visual Studio designer support in .NET Framework 4.7 (or later) and .NET 10 (or later) applications. Set one property and the combo box and its dropdown follow the Windows light/dark setting. The control scales with the DPI of the monitor showing it, honors the Windows contrast themes and has built-in UI Automation support for Narrator, NVDA, JAWS and other screen readers.
A license is per developer and royalty-free, sold on its own.
Member mapping
SftBox/NET is not a drop-in replacement: there are no Appearance objects and no grid layout behind the list, and the dropdown's columns, headers and items are reached through the control and its List property. Many names will still look familiar. This table shows where each UltraCombo member is found.
| Task | UltraCombo | SftBox/NET 3.0 |
|---|---|---|
| Data source | DataSource, DataMember, SetDataBinding | SftBox.DataSource, SftBox.DataMember (set DataMember first) |
| Display and value | DisplayMember, ValueMember, Value | SftBox.DisplayMember (or DisplayColumn), SftBox.ValueMember, SftBox.SelectedValue |
| Selected row | SelectedRow, Rows | SftBox.SelectedItem (an ItemClass), SftBox.SelectedDataItem (the data row), SftBox.Items |
| Columns | DisplayLayout.Bands[0].Columns, Hidden, InitializeLayout | SftBox.Columns, each column naming its ColumnClass.DataMember; only the columns you define are shown |
| Column headers | Header.Caption | SftBox.List.Headers[row, column].Text, shown when SftBox.List.Headers.Visible is set |
| Column widths | UltraGridColumn.Width | ColumnClass.Width, ColumnClass.MakeOptimal |
| Alternate row colors | Override.RowAlternateAppearance | ListClass.BackColorOdd, ListClass.ForeColorOdd |
| Per-row setup | InitializeRow | ListClass.ItemDataBound |
| Sorting | Bands[0].SortedColumns | ItemCollectionClass.Sort, by any column, for a list filled from code; a bound list is sorted through its data source |
| Batch updates | BeginUpdate, EndUpdate | SftBox.List.Initializing |
| Selection events | RowSelected, ValueChanged | SftBox.SelectedItemChanged, SftBox.SelectionCommitted, SftBox.SelectedValueChanged |
| Style | DropDownStyle (DropDown, DropDownList) | SftBox.Style (DropDown, DropDownList, Simple) |
| Edit field | Text, MaxLength, ReadOnly, SelectedText, SelectionStart, SelectionLength, SelectAll | The same names |
| Empty field | NullText | SftBox.Placeholder, SftBox.PlaceholderForeColor |
| What the field shows | EditAreaDisplayStyle | SftBox.SelectionDisplay: the whole item with its columns and images, or its text |
| Type-ahead | AutoCompleteMode, AutoSuggestFilterMode | SftBox.SearchMode (AutoComplete, Contains, Filter), SftBox.SearchColumn, SftBox.DropOnInput |
| Finding an item | IsItemInList | SftBox.FindItem, with a column and a search mode |
| Values not in the list | LimitToList, ItemNotInList | The DropDownList style, or a check of SftBox.SelectedItem in Validating |
| Dropdown width | DropDownWidth | SftBox.DropDownWidthMode (Control, Optimal, Fixed), SftBox.DropDownWidth |
| Dropdown height | MaxDropDownItems | SftBox.DropDownItems |
| Resizing the dropdown | DropDownResizeHandleStyle, PreferredDropDownSize, AfterDropDownResize | SftBox.DropDownResizable, SftBox.DropDownSize, SftBox.DropDownResized |
| Opening and closing | IsDroppedDown, ToggleDropdown | SftBox.DroppedDown, SftBox.OpenDropDown, SftBox.CloseDropDown |
| Dropdown events | BeforeDropDown, AfterDropDown, AfterCloseUp | SftBox.DropDownOpening, SftBox.DropDownOpened, SftBox.DropDownClosed (whose Accepted tells whether an item was chosen) |
| Buttons in the field | ButtonsLeft, ButtonsRight | SftBox.ShowClearButton, SftBox.ButtonImage, SftBox.ButtonImageDropped |
| Colors and borders | Appearance, BorderStyle, UseOsThemes | SftBox.BackColor, SftBox.ForeColor, SftBox.BorderStyle, SftBox.BorderColor, SftBox.UseThemes |
UltraComboEditor
An UltraComboEditor filled from code maps the same way. Its Items become SftBox.Items, filled with ItemCollectionClass.Add, one string per column; keep an item's data value in ItemClass.TagObject, or bind the list and use SftBox.ValueMember. SelectedItem is SftBox.SelectedItem, SelectionChanged and SelectionChangeCommitted are SftBox.SelectedItemChanged and SftBox.SelectionCommitted, FindString and FindStringExact are SftBox.FindItem with the Prefix and Exact search modes, DropDownListWidth is SftBox.DropDownWidthMode, DropDownListAlignment is SftBox.DropDownAlignment, and SortStyle is ItemCollectionClass.Sort.
The same combo box in both
Both examples bind a table of countries, show the name and the capital in the dropdown, display the name in the field, use the id as the value and react when the user picks a country. With UltraCombo:
ultraCombo1.InitializeLayout += ultraCombo1_InitializeLayout;
ultraCombo1.RowSelected += ultraCombo1_RowSelected;
ultraCombo1.DropDownStyle = UltraComboStyle.DropDownList;
ultraCombo1.DisplayMember = "Name";
ultraCombo1.ValueMember = "Id";
ultraCombo1.DataSource = countries;
private void ultraCombo1_InitializeLayout(object sender, InitializeLayoutEventArgs e) {
e.Layout.Bands[0].Columns["Id"].Hidden = true;
e.Layout.Bands[0].Columns["Name"].Header.Caption = "Country";
}
private void ultraCombo1_RowSelected(object sender, RowSelectedEventArgs e) {
if (e.Row == null) return;
labelInfo.Text = e.Row.Cells["Name"].Value + ", capital " + e.Row.Cells["Capital"].Value;
}
With SftBox/NET, the columns are defined before the data source is set:
sftBox1.Style = BoxStyleEnum.DropDownList;
sftBox1.Columns.Count = 2;
sftBox1.Columns[0].DataMember = "Name";
sftBox1.Columns[1].DataMember = "Capital";
sftBox1.List.Headers.Visible = true;
sftBox1.List.Headers[0, 0].Text = "Country";
sftBox1.List.Headers[0, 1].Text = "Capital";
sftBox1.DropDownWidthMode = DropDownWidthModeEnum.Optimal;
sftBox1.DisplayMember = "Name";
sftBox1.ValueMember = "Id";
sftBox1.SelectedItemChanged += sftBox1_SelectedItemChanged;
sftBox1.DataSource = countries;
private void sftBox1_SelectedItemChanged(object sender, EventArgs e) {
DataRowView row = sftBox1.SelectedDataItem as DataRowView;
if (row == null) return;
labelInfo.Text = row["Name"] + ", capital " + row["Capital"];
}
You can also skip most of this code: columns, headers and the dropdown are set up in the Visual Studio designer.
Migration notes
- Columns are added, not hidden. UltraCombo creates a column for every column of the data and you hide the ones you don't want. SftBox/NET shows the columns you define, each naming its data member; define them before setting DataSource, where InitializeLayout used to do it.
- The selection changes when the user chooses. Moving through the open list with the arrow keys does not change SelectedItem; choosing an item does, and SelectionCommitted is raised for every choice, even of the item already selected.
- No match means null. SftBox.SelectedValue is null while the field matches no item, where UltraCombo's Value returns the typed text.
- The list search is SearchMode. SftBox/NET also has AutoCompleteMode, AutoCompleteSource and AutoCompleteCustomSource, but they are the Windows text completion of a TextBox (file names, URLs, your own strings).
- The bound position follows the choice. SftBox/NET always moves the CurrencyManager to the item the user chooses, as UltraCombo does with SyncWithCurrencyManager.
Before you start
SftBox/NET selects one item at a time. A dropdown where users check several rows (UltraCombo's CheckedListSettings) needs a different design.
Try it
The free trial includes the working control and the C# and VB.NET samples. Replace one UltraCombo in your own forms before you buy. A license is per developer, royalty-free, and includes one year of support and upgrades.
Infragistics, UltraCombo and UltraComboEditor are trademarks of Infragistics, Inc. Softel vdm is not affiliated with Infragistics.
