Questions tagged [itemssource]
374 questions
0
votes
2 answers
How to bind a specific property in a DataTemplate independent of ItemsControl in ItemsControl
I have following DataTemplate

U.Kaya
- 27
- 3
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
- 289
- 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,472
- 3
- 29
- 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
- 191
- 2
- 13
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
- 141
- 1
- 2
- 6
-1
votes
1 answer
Listview show data issue
I have created a "Listview" and a "Gridview" to show some data, and everything looks fine, but whenever I add data to the "Listviews ItemsSource", it doesn't show it, the only thing I can see are marked lines (see below).
The XAML code for the build…

user1845777
- 145
- 1
- 9
-1
votes
1 answer
WPF - Itemssource in a Button
everyone,
I would like to add an Itemsource to a button so that I can access the sub-values. If I do the whole thing with ItemsControl, I get a button for each value. However, I only need one button. Can i limit this?
My Output: 30 Buttons -> I need…

Sascha
- 37
- 6
-1
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. …

dkalkwarf
- 313
- 2
- 11
-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…

AdvApp
- 1,094
- 1
- 14
- 27
-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
- 1
- 9
-1
votes
1 answer
How to eject the class fields from control?
I have my own user control. This control's code:

user8710232
- 3
- 2
-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
- 20,083
- 9
- 69
- 114
-2
votes
1 answer
Read .txt file to listbox without ItemsSource binding OR remove binding without clearing the listbox of the lines
I'm fairly new to C# but understand basic concepts.
I'm currently working on a Uni assignment where I have to have multiple textboxes be entered as a single entry in a listbox, then save all entries to a text file. I also need to be able to load the…

Joshua Hughes
- 1
- 2
-3
votes
1 answer
C# ItemsSource for ComboBox with inheritance
I've got a List like:
List personList;
In this list are objects that inherit from Person: Staff and Manager.
I have a ComboBox cmbList.
Now I would like to set the source of this ComboBox to the Staff objects from the personList.
How…