Questions tagged [compositecollection]

50 questions
2
votes
0 answers

compositeCollection DataContext false warning, renaming issue

I try to bind a ListBox.ItemsSource to a CompositeCollection containing three CollectionContainers. Each CollectionContainer is bound to a ObservableCollection in my ViewModel. Because the CompositeCollection does not know my DataContext, i set the…
quadroid
  • 8,444
  • 6
  • 49
  • 82
2
votes
1 answer

what are the advantages of using compositecollection rather than an observablecollection?

I need a list of applicable view models and am debating whether to try to make a composite collection or to create a shared interface that they inherit from. Is one method preferred? I assume that composite collection maintains an index of the…
James Joshua Street
  • 3,259
  • 10
  • 42
  • 80
2
votes
1 answer

How do I convert a ComboBox to use a bound CompositeCollection?

I have a ComboBox that has a bound items source... I've stripped my example down to the key pieces:
BobTheBuilder
  • 2,455
  • 2
  • 27
  • 39
1
vote
0 answers

How to use CompositeCollection in WPF and MVVM

I have a WPF app using MVVM. I have a DataGrid on the form and the DataGrid has a column with a ComboBox that contains an ObservableCollection. I want to add a "Please Select From List" to the top of the ComboBox. I tried using CompositeCollection…
Jerry
  • 6,357
  • 8
  • 35
  • 50
1
vote
1 answer

Data Binding a Collection Dependency Property to a menu in a User Control

I have a user control with its own context menu, however I need to add additional items to that menu. The approach I took was to have a dependency property called ContextMenuItems: Public Shared ReadOnly ContextMenuItemsProperty As…
Darren
  • 4,408
  • 4
  • 39
  • 57
1
vote
0 answers

How can a custom iterator notify subscribers of changes to its iterated items (think 'INotifyCollectionChanged')?

We're trying to expose the contents of two child collections as an additional, all-inclusive IEnumerable property. People have suggested using CompositeCollection for this case, but there are two issues: There doesn't appear to be a read-only…
1
vote
1 answer

C# WPF Static item and binding combobox

I am trying to do some simple thing in WPF but can't find the way to do it. I have a ComboBox in a DataGrid header to filter data. The data is binded to a GrouBy statement of all my data. These show some CheckBox The XAML code…
user3704628
  • 143
  • 1
  • 12
1
vote
2 answers

In a datagrid, how do you bind a different ItemsSource for each row when also using a CompositeCollection?

I have a DataGrid where the ItemsSource is bound to an ObservableCollection Each item in the ObservableCollection also has an ObservableCollection of strings. One of the columns is a DataGridTemplateColumn…
1
vote
2 answers

XAML binding to CompositeCollection

I have only one datagrid in a single view but the collections which are ItemsSource's of this datagrid are in different View Models. So is it possible to bind this single datagrid in view with the collections in two different View Models? For each…
Kumar
  • 15
  • 1
  • 6
1
vote
1 answer

Populating MenuItem with composite collection "doubling" up

I'm trying to populate a menu item with a collection of children items. That was easy, however I need to add an extra that's always present that performs an "add" operation. I used a composite collection to add this on to the existing collection of…
Joe
  • 6,773
  • 2
  • 47
  • 81
1
vote
1 answer

Dynamically binding and statically adding MenuItems - using view Models/MVVM

I'm trying to have a dynamic menu item using MVVM from an observable collection. Everything worked, but then I needed to add a "add new" button to the end. I found a solution using a CompositeCollection, like here: How do I dynamically bind and…
Joe
  • 6,773
  • 2
  • 47
  • 81
1
vote
2 answers

WPF Combobox CompositeCollection bind ComboboxItem Content and list of strings

I am using WPF and I have a combobox in my view. My requirement is to display a list of names (ranging from 0 to n elements) and a localizable string "Dummy Name" in the combobox. So I take the ItemsSource of the combobox from two different sources,…
user975561
  • 514
  • 1
  • 6
  • 17
1
vote
1 answer

Binding a set of lists to a combobox from another list of objects which contain the lists

For simplicity sake, I am going to use the idea of a "car make" and a "car model" to explain my problem. I have a list of car make objects and each car make has its own list of car models. I need to populate a combo box which contains a list of…
JLB
  • 35
  • 5
1
vote
1 answer

DateGridTextColumn disable null values

I have a DataGridTextColumn binded with a CompositeCollection of 4 ObservableCollection One of the DataGridTextColumn, binded like this:
Kraenys
  • 297
  • 1
  • 5
  • 19
1
vote
2 answers

Any idea on how to sort a CompositeCollection?

I have a CompositeCollection that consists of ObservableCollections of two types: Companies and Contacts. Contact has a property FullName while Company has a property Name. I want to apply sorting so the collections are mixed by their types but…
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632