Questions tagged [itemscontrol]

Represents a control that can be used to present a collection of items.

An ItemsControl is a type of WPF Control that can contain multiple items, such as strings, objects, or other elements.

1200 questions
12
votes
2 answers

How to highlight selected item in ItemsControl?

I have the following XAML. How can i highlight the selected item in the ItemsControl ? I can override the selected item template for ListView but how to achieve the same for ItemsControl? Is there any alternative control that can display a…
Lucifer
  • 2,317
  • 9
  • 43
  • 67
12
votes
1 answer

ItemsControl Drag and Drop

I have an ItemsControl with a DataTemplate that is bound to an ObservableCollection of integers.
KrisTrip
  • 4,943
  • 12
  • 55
  • 74
11
votes
3 answers

Should my ViewModel have an ObservableCollection of Views or ViewModels?

I'm trying to understand the basic MVVM design approach when using ItemsControl by binding it via DataTemplates to ObservableCollections on the ViewModel. I've seen examples that bind to ObservableCollections of strings, Views, and…
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
11
votes
1 answer
11
votes
4 answers

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl

i have a problem with WPF Binding. I want to bind a list of Months to a ItemsControl that shows a Calendar Control for each month. But each rendered Calendar shows DateTime.Now,not the bound DateTimes. Does anyone know why this is happening? This is…
ovm
  • 2,452
  • 3
  • 28
  • 51
11
votes
2 answers

Strange focus behavior for simple WPF ItemsControl

I'm seeing strange behavior when it comes to focus and keyboard navigation. In the example below I have a simple ItemsControl that has been templated so that it presents a list of CheckBoxes bound to the ItemsSource.
jpierson
  • 16,435
  • 14
  • 105
  • 149
11
votes
6 answers

Scrolling to an element of a virtualising ItemsControl

I have a ItemsControl which displays its items in a ScrollViewer, and does virtualisation. I am trying to scroll that ScrollViewer to an (offscreen, hence virtualised) item it contains. However, since the item is virtualised, it doesn't really exist…
Seth Carnegie
  • 73,875
  • 22
  • 181
  • 249
10
votes
2 answers

How to add a border to an item in a ItemsControl?

I am trying to set a border to each item from a items control. Following is my XAML code. But this doesn't work.