how to display most recently used list in combo box - wpf

I'm using infragistics WPF editors and XamComboEditor. In previous WinForms version there was MRU list capability. What it basically does is it displays list of most recently used items at the beginning of the list and separates those items with some separator (which cannot be selected). Regular list of combo box items follows after this separator.
Now, infragistics combo does not provide this functionallity. I'll have to develop it on my own and the question is how to approach this. My biggest concern is how to modify current combo box (it can be regular wpf one) to actually display it.
Any suggestions are welcome.

To handle the actual UI part you can use CollectionViewSource/ICollectionView's Grouping and optionally Sorting (if you want the MRU to be ordered) to modify the ComboBox's view of the collection. Most of the work is going to be setting up the data which will be specific to your situation but all you'll need to do in the UI after you're bound to a grouped ICollectionView is set a GroupStyle on the ComboBox where you probably want to show a separator only for the non-MRU group and nothing for the MRU.

Related

ListView - Selected Item in the middle

I'm building a Windows Store app using XAML. I have a scrollable ListView that has its SelectedItem set on start.
Now, I have two requirements:
I would like the selected item to be always visible
In addition it
should be displayed in the middle of the list when possible (it's
not possible for the first element).
The first requirement I can partially fulfill by using list's LayoutUpdated event and list.ScrollIntoView(item) method, but this doesn't allow me to scroll down the list manually until the item is unselected.
For the 2nd requirement I have no ideas.
Ok, found out how to achieve that: http://fczaja.blogspot.com/2013/05/xaml-listview-scroll-selecteditem-to.html

How to show additional info in a vaadin combobox selection list?

I'd like to have a combobox where there is a lot of information in the list to select from or search but only parts of it are shown after selection.
For example when the user starts typing "raf" the combobox should show a list like this:
RA - Raffael (raffael#example.com)
HU - Hugo (hugo#rafferty.xyz)
After selecting the entry "Raffael" only "RA" should be shown in the combobox.
I need that because of the limited space for the combobox in my application. So the combobox should not be wider than needed to hold some characters but the list to select from may be much wider. Is there an easy way to achieve that? Or which function i have to overwrite in combobox to set the text line after the selection?
Thanks
This is not possible with a standard Vaadin ComboBox without custom client side coding.

Silverlight Editable Combo Box

I want to use comobox which is editable in my silverlight project, but silverlight doesnt provide a such control.
If any one knows how to create a custom editable combobox in silvelight 4.0 then please help me.
Editable combobox means:
A combo box providing list of
options.
User can enter the value.
Filtering.
Sounds like you are looking for the AutoCompleteBox.
Allows user to type value
Can simply dropdown like a combox
Partial value typed can be used to filter choices using either StartsWith or Contains mode.
Supports a create new entry operation if the final typed value does not match any existing entry
This control is part of the standard SDK and is found in the System.Windows.Controls.Input.dll. You should be able to drag it from the toolbox.
You can also have a look Lookup Combo Box

How to add an unselectable separator to a combobox in SWT

A combobox in our application should show fixed-width and non-fixed-widths font names. I want to add an unselectable separator between them:
-- Fixed-width fonts --
Courier New
Lucida Console
...
-- Non-fixed-width fonts --
Arial
...
Is that possible with SWT?
The short answer is no. Neither Combo nor CCombo allow to flag items as unselectable.
But it should be possible to implement a custom combo widget that can show unselectable items with reasonable effort.
If you look into the CCombo code you will see that it is not a native widget but composed of other SWT widgets. It uses a List as the drop-down control to display the items.
If you use a ScrolledCompposite for the drop-down widget, you could place Labels therein to represent items. Unselectable items wouldn't require extra work. For selectable items, you could use mouse listeners for the Labels to highlight them when hovered and to handle selection.
If you plan to show a large number of items (which you shouldn't anyway in a combo box), the number of created labels may have a performance impact.
Alternatively, you may want to try the Nebula TableCombo. Possibly the table can be tweaked to show some items as unselectable (using custom-drawn items) and the selection behavior can be disabled for those.

WPF DataGrid - Setting RowDetails programmatically

I'm using the WPF DataGrid, and I'd like to know if there is any way I can access the DataGridRow's RowDetails programatically.
For example, when the user selects the row, I'd to grab some data from somewhere (say, a database), and display it in the RowDetails.
All of the examples I've seen tend to just display some extra bound data that isn't included in the columns for the row.
You could display some extra data but lazy-load it on SelectionChanged.
It usually is not easy to work directly with the WPF controls, they are not really meant to be used without a backing databound model.
If you have all the data in list of objects (or something similar) then you can do all sorts of fun things. I'm using a WPF Datagrid in this manner, and when a user selects a row, I think populate an editor control above the grid with the row item plus additional details.
That said, there's nothing stopping you from adding in additional information in the grid that's normally hidden and a trigger on row selection to show the additional data
you can use the following code
DataRowView row = (DataRowView)MyDataGrid.SelectedItem;
string strName = row.Row["Name"].ToString(); //where "Name" is the column name

Resources