I was wondering, is it possible to display a grid in a comboBox as its selectedValue (or displayMemberPath) ?
I wanted to do something like that :
It's a screen from Telerik's comboBox, but I wish to do the same in WPF only. I already use a grid inside the dropdown and it works pretty well, and I'd achieve something cool if I could display many rows as a selectedValue. I supposed I'd use a grid but applying a grid in the displayMemberPath style doesn't really work.
My comboBox is inside a DataGridTemplateColumn but I don't think it matters, just saying.
Thanks !
Related
I want to have a control similar to this? Is there a way to do this using WPF.
Sample Image:
It is like a combobox but its comboboxitems works as menuitems. The menu item selected would be displayed in the combobox.
If you need menu item then use menu item. I think it would be much harder to customize combobox.
I want to bind an user control as an item of a ComboBox, is this possible?
I want to get a ComboBox like this:
Thanks.
do you want all items in your combobox to render like your picture? so if you have 4 items it should look like this?
if yes, the easiest way would to create a datatemplate for your type of object you wanna show in your combobox.
if not you should specify your question
for an overview, an MVVM project in built in WPF.
Basically in my xaml, I have a datagrid bound to a dataview. When my service populates the dataview I get a dynamic table with an arbitrary number of columns.
For each column in the datagrid, I have created a headertemplate which contains a combobox which is bound to an Observable<Dictionary<string,BusinessEntity>> object as its item source in the xaml. Figuring out the combobox is another issue but I am trying to just populate data grid first, then worry about binding the combobox correctly.
anyways the only solution I have somewhat though of was to turn on autogeneratecolumn and then replacing all the headers with a combobox in the codebehind, but then I have issues trying to bind the combobox in the codebehind correctly and it doesn't feel MVVM if I have to create all those comboboxes there.
You can handle the AutoGeneratingColumn event to customize the auto generated column's header template.
Is there a way to create a "header row" for a winforms combo box?
So that's it's always displayed at the top?
The quick answer is: probably not. You would have to make your own usercontrol to do something like that.
This Getting ComboBox to show a TreeView shows how to so something like that. Just replace the treeview with a usercontrol that contains a label at the top and a listbox. Pass your combobox list of items to the usercontrol, etc.
I need to add a rowheader to a Listview GridView. it needs to act like a datagrid rowheader, sop it should be freezable.
is thsi possible? can anyone show me some source code to do this?
Thanks
The GridView do not have rowheaders but you can style the first column differently than the rest. Implementing freezing will require some innovative use of a scrollviewer. Can't you just use the DataGrid which has RowHeaders?
DataGrid Class