itemscontrol

ItemsControl Drag and Drop

I have an ItemsControl with a DataTemplate that is bound to an ObservableCollection of integers. <ItemsControl Name="DimsContainer" ItemTemplate="{StaticResource DimensionsTemplate}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ItemsCont...

Specify ControlTemplate for ItemsControl.ItemContainerStyle

The following is similar to what I'm trying to accomplish. However, I get an "Invalid PropertyDescriptor value" error on the Template Setter. I suspect it's because I didn't specify a target type for the Style; however, I don't know the container type for ItemsControl. <ItemsControl> <ItemsControl.ItemContainerStyle> <Sty...

How to use AlternationIndex in ItemsControls?

I have seen some articles that show how to use AlternationIndex with ListBoxes or ListViews, but I had spent a few hours trying to get alternating background colors on the base ItemsControl class and nothing seems to work. All ListBox samples I saw use ListBoxItem as the target type for the style that sets the background based on Alterna...

WPF: Srollviewer not working in Items control.

I have a itemscontrol under scrollviewer. and under this items control I have another Usercontrol with items control under scroll viewer. something like this: scrollviewer itemscontrol .... /itemscontrol /scrollviewer under the above itemscontrol there is a usercontrol having: scrollviewer itemscontrol .... /itemscontrol /scrollviewer...

how to manipulate ItemsControl ItemTemplate

Hi. I am trying something simple but struggling to get a simple solution, just not seeing it hehe. I have a number: “150” witch can be split in any number of segments when the user enters the segment amount in a textbox; a items control gets populated with textboxes showing the segment sizes. This works. I want to be able to edit a se...

Creating an infinite Silverlight ItemsControl

I'm interested in creating an ItemsControl for Silverlight that "loops" the items. When the user scrolls to the end of the list the ItemsControl should then show the first item(s) in the list. If the user scrolls above the first item in the list the ItemsControl should show the last item(s) in the list. It probably makes sense here fo...

Access my Views from bound ItemsControl

Hi! I have a typical MVVM scenario: I have an ItemsControl bound to an ObservableCollection of StepsViewModels. I define a DataTemplate so that StepViewModels are rendered as StepViews. The same happens in the StepView: I have an ItemsControl to an ObservableCollection of ParameterViewModels with a DataTemplate to render them as Paramete...

Silverlight's ItemsControl Canvas.TopProperty and Canvas.LeftProperty not used

Hi, I want to create a canvas where a user can drop UI elements (representing tasks). He can then drag them to rearrange them. The elements are contained in an ObservableCollection that is the DataContext. I can set the Left and Top properties of the Canvas, but the objects position is not affected. Any ideas? Thanks, Karel UPDATE...

ItemsControl "Overflow to Popup"

Hi, I have an ItemsControl that I want to fit into a small space. Typically it will display less than 3 items, however, I would like the it to indicate when it has more items than it can display and have a popup on the indicator to show all items (which will still be aa small amount). The current ItemsContainerPanel is a WrapPanel, wh...

ItemsControl, ItemsPanel and ItemsPresenter (Silverlight, XAML)

I'm utterly confused by these 3 terms, when to use which? What's the relationship and they are children of which controls? Is it correct to say this is the tree: ItemsControl > ItemsPresenter > ItemsPanel ...

How to display search results in a WPF items control with highlighted query terms

I'd like to display search results within a WPF ItemsControl with the query terms highlighted. The search engine I use, Lucene.Net with the Highlighter plugin, returns strings with the query terms marked up like so: ...these <Bold>results</Bold> were found to be statistically significant... I can instruct the Highlighter plugin to us...

WPF drag and drop from a ListBox that has SelectionMode=Extended

I have a ListBox and want the selection-mode to be extended. Also I want have to implement drag and drop functionality. The problem now is, that if the mouse is clicked on a selected item, it will be immediately be selected as single selection instead of waiting to the mouse-up-event for doing this. Due to this behaviour, start dragging...

Enhance ItemsControl or tweak ListBox Selection

I have a number of items which I wish to be contained in either a ListBox or an ItemsControl. The size of the control is fixed, but the size of its contents are not. It is possible for this control to have 13 items inside, but if the user wishes, only one is displayed at a time, and takes up the entirety of the available space. Two items...

Calculate sum , average based on list of items in WPF

Hi, In WPF, I want to display sum, average values based on the List of Items provided. For example, I have an Employee object with Salary Property, and I want to calculate total salary based on the employee list. Also, the employee object is data bound to a Items control where the Salary will be edited/new Employee may be added to the ...

WPF datatemplate ItemsControl specifying initial and final values

I have been using ItemsControl for quiet sometime in WPF. I am using MVVM for developing my application. Now I have run into a problem. I have a requirement where in based on number of values in a IList<> , I have to display the number of TextBoxes separated by a comma in between. I have written an ItemsControl which iterates over the b...

Why Does ItemsControl Not Use My ItemTemplate?

I am able to use an ItemTemplate within an ItemsControl to render items in a specific format. However, if one of the items within the ItemsControl happens to be, say, a TextBox, that TextBox is rendered rather than an instance of the ItemsTemplate. From what I can tell, this is true for any FrameworkElement. Is this intended behavior ...

Binding in PrepareContainerForItemOverride method.

Hi! I try to implement PrepareContainerForItemOverride method of ItemsControl. It will put items to TextBox. It works nice, but how can I binding an item to the textbox text property? One way mode works nice, but when I want two way mode, I have to know the path. Here is my code: protected override void PrepareContainerForItemOverride...

DockPanel ItemsControl lastchild fill

I have a dockpanel that I dynamically fill using an ItemsControl to populate the panel. The dockpanel needs the last child from the itemscontrol list to fill the rest of the panel, but it doesn't seem to happen if I populate it in this fashion... what can I do to get that last item to expand? snippet of how I have it set up: (note I se...

WPF ItemsControl ItemTemplate border with GroupStyle

This is the first time I've posted a pic, so hopefully it turns out well (a picture is worth a thousand words, and I don't want to type a thousand words). But, the image below is what I'm trying to accomplish. I have a collection of objects that I'm needing grouped by property "Group". I'm using a CollectionViewSource that is bound to m...

Combining ItemsControl with draggable items - Element.parent always null

I'm binding an ItemsControl with Canvas as ItemsPanelTemplate to an ObservableCollection. I want to make the items draggable using the DraggableExtender as posted in http://stackoverflow.com/questions/294220/dragging-an-image-in-wpf (I don't want to use transforms - I need to use the Canvas Left and Top properties) It's defined as : ...