Questions tagged [itemssource]

374 questions
5
votes
4 answers

Show if ItemsControl.ItemsSource is null

Greetings, I have a ItemsControl which template I changed to show a RadioButton for every object in the binded ItemsSource. However the ItemsSource can be empty and when it is empty I'd like to show a default value. Something like "The binded list…
Theun Arbeider
  • 5,259
  • 11
  • 45
  • 68
5
votes
1 answer

WPF ComboBox Doesn't Display SelectedItem after one DataTrigger but does for another

So I have a combobox I'd like to reuse for multiple sets of data rather than having 3 separate comboboxes. Maybe this is bad and someone can tell me so. I'm open to all ideas and suggestions. I'm just trying to clean up some code and thought one…
Birdbuster
  • 1,499
  • 1
  • 9
  • 13
5
votes
1 answer

How can I use a collection class as a static resource in silverlight

I have a simple class named Customer with 2 properties. public Name {get;set;}public LastName {get;set} Then I made a collection class named CustomerList with only one public property named Customers public class CustomerList { public…
Panagiotis Lefas
  • 1,113
  • 2
  • 12
  • 24
5
votes
1 answer

Binding List to a ListBox in WPF

I have a class called Person, with just name, age and gender properties. And I also have a List of 5 people (hard-coded for now, but not relevant). I want to bind it to a ListBox through XAML so it has three TextBlocks for each of the…
5
votes
3 answers

WPF Merge ItemsSource Lists

I am working with a 2 lists in a backend class. Each list is a different type. Would like to present the user with a single list (containing a union of both lists) of which when an item in this list is selected the item's details appear. The code…
Gus
  • 649
  • 5
  • 14
5
votes
1 answer

Need SIMPLE working example of setting WPF MVVM ComboBox ItemsSource based on SelectedValue of second ComboBox

Can anyone show me a simple working example for a WPF MVVM application to set the ItemsSource of combobox B based on the SelectedItem of ComboBox A? It seems from what I've found on this site that it gets all too complicated all too quickly. What's…
Andrew Gray
  • 3,593
  • 3
  • 35
  • 62
5
votes
1 answer

Dynamically changing ItemsSource of a WPF ComboBox

I have a WPF application that contains two comboboxes (we'll call them cbox1 and cbox2). cbox1 has its ItemsSource bound to an enum via XAML like this:
bmt22033
  • 6,880
  • 14
  • 69
  • 98
5
votes
2 answers

WPF TreeView hierarchical binding.

just starting with wpf. I need to bind the object (Hierarchical) Folder public class Folder { public Folder() { this.Name = string.Empty; this.Modules = new ObservableCollection(); this.Folders = new…
5
votes
1 answer

Bind DataGridTextColumn Visibility Property in WPF

I have a datagrid whose ItemsSource binds to a CollectionViewSource. In each column I specify the Path property of the binding to get the specific information to display. What I'd like to do is toggle some of the columns with a checkbox if the user…
KyleMit
  • 30,350
  • 66
  • 462
  • 664
4
votes
2 answers

Why shouldn't UserControls be used as an ItemsSource?

I was answering another question on here where the user had a ListView with an ItemsSource containing UserControls. I said I wouldn't recommend it, and got asked why. This really surprised me. I've never considered it before. I know it's not a good…
Rachel
  • 130,264
  • 66
  • 304
  • 490
4
votes
3 answers

Xamarin Forms Collection view ItemsSource Binding not updating the UI

Xamarin.Forms 4.0 collection view ItemsSource binding is not working as expected if I set the binding in code behind. The items are displayed based on the initial value of the source collection but, the UI is not updating when the source collection…
Narender Reddy
  • 145
  • 1
  • 1
  • 9
4
votes
1 answer

How to assign ItemsSource property

Okay, sorry for my previous mess. The situation is this: I have two custom objects defined as follows: MainObject: public class MainObject { private string mainObjectName; public string MainObjectName { get { return mainObjectName; } } …
EnvelopedDevil
  • 658
  • 1
  • 13
  • 29
4
votes
0 answers

Set ItemsSource of Control to another control's ItemsSource that is Static and set in Xaml

I am building a UWP Windows 10 App. In a Page I have a FlipView that has static items. Instead of binding them to an ItemsSource, it was easier to set them in Xaml as:
yalematta
  • 1,389
  • 1
  • 21
  • 36
4
votes
1 answer

Get access to child items in MenuItem when ItemsSource is use, C#\WPF

I have MenuItem that uses ItemsSource.
SkyDancer
  • 129
  • 1
  • 4
  • 13
4
votes
1 answer

ListBox ItemsSource WPF Binding

I'm not understanding something about binding. I have a DataTemplate for type Object which is working, but in there I want to make another ListBox and set the data to that of one of the properties of an Object. I've been using Snoop to look at the…
user2013535
  • 73
  • 1
  • 1
  • 7
1 2
3
24 25