Questions tagged [itemssource]

362 questions
0
votes
1 answer

In WPF I have a TreeView whose ItemsSource is binded to a static resource. How can I change this so that the tree updates when the items change?

I have a TreeView whose ItemsSource is binded to StaticResource, which is a class. This has worked fine for me, but now I have a function that updates the lowest level of the TreeView with possible different values and this update needs to be shown…
0
votes
1 answer

How to bind WPF ContextMenu ItemsSource?

I'm trying to bind Button's context menu this way: (UserControl has Values property). Why…
Evgenyt
  • 8,665
  • 12
  • 36
  • 44
0
votes
1 answer

Custom Panel InternalChildren order differs from bound ItemsSource

I'm writing a custom ItemsControl and Panel that arranges items vertically in the order in which they were added to the ItemsSource bound to the ItemsControl. Note that this is just a prototype of the final Panel, whose arrangement will be a bit…
Zodman
  • 2,001
  • 1
  • 24
  • 35
0
votes
2 answers

Setting ListBox ItemsSource to an object from StaticResource as shown in MSDN

I was exploring DataTemplate and found Styling and Templating on MSDN. It says - "In this sample application, there is a ListBox control that is bound to a list of photos:
atiyar
  • 6,349
  • 6
  • 29
  • 62
0
votes
3 answers

Setting ItemsSource before or after adding items changes object?

I have a bit of a weird situation, I've implemented a ObservableConcurrentDictionary (based on the ConcurrentDictionary from .NET), which I used to implement ObservableConcurrentCollection (which just automatically sets the Key property in the…
The Cookies Dog
  • 1,696
  • 2
  • 18
  • 34
0
votes
1 answer

ComboBox ItemsSource has a different datacontext from SelectedItem

I have ComboBox where I get my ItemsSource from my "Settings" object with the UserTypes ObservableCollection inside, and I need to bind its SelectedItem to my "Employee" object's type property. There are other fields within the window, which binds…
Erika
  • 339
  • 1
  • 5
  • 20
0
votes
1 answer

Creating a databound control through c# code?

I know that in XAML it's possible to create data templates with code so you can style & bind controls to your liking:
Joel Murphy
  • 2,414
  • 2
  • 26
  • 47
0
votes
1 answer

Updating ListBox causes delay

I want to display a ListBox with around 10 items in it. Every time I update it by adding an item to a List it causes a little but noticeable delay and the UI freezes for a little while. I also tried using an ObservableCollection instead of a List as…
Stacksatty
  • 159
  • 1
  • 10
0
votes
2 answers

Unable to update listbox from database

In my application I have listBox and its items source is ObservableCollection, but when I add data, this listBox won't update. In constructor i use: listBoxPersons.ItemsSource = UserContacts; and user UserContacts is static ObservableCollection,…
Timo
  • 121
  • 1
  • 2
  • 5
-1
votes
1 answer

WPF Datagrid -- How to force commit of data in row?

How can I force a commit when a datagrid row loses focus as opposed to requiring the user to press return to commit? I have a MVVM project with a main DataGrid using a RowDetailsTemplate that contains another sub DataGrid. It uses the default…
IronRod
  • 874
  • 10
  • 21
-1
votes
1 answer

WPF ItemsSource binding show only last item of list

How to show only last item of the list in itemssource binding ? below is my current code. xaml
sigmax bpo
  • 27
  • 8
-1
votes
1 answer

How to eject the class fields from control?

I have my own user control. This control's code:
-1
votes
2 answers

Link ListView Items to Individually Different Lists

I've defined a ListView where each item is displayed with a read-only (i.e. selection-only, no TextBox) ComboBox (as per the ItemTemplate). There is a given list of possible items that can be chosen from each of these combo boxes. The caveat,…
O. R. Mapper
  • 18,591
  • 9
  • 58
  • 102
-2
votes
1 answer

Same ItemsSource in multiple ComboBox elements, SelectedIndex synced for all ComboBox elements, want separate

I have multiple ComboBox elements. Each ComboBox's ItemsSource is bound to the same property. That property is a ListCollectionView whose underlying list is an ObservableCollection. Each ComboBox's SelectedIndex is bound to a different property. …
DaveK
  • 141
  • 1
  • 9
1 2 3
24
25