itemtemplate

Silverlight ItemsControl with Alternating ItemTemplate

Silverlight does not support Alternating Item Templates in an ItemsControl. I have a few ideas in mind as to how to accomplish this, but to avoid polluting the potential answers, I'll leave them out. The idea is the same as a normal ItemTemplate in that it won't depend on anything in the bound data context to function. I would like th...

How to bind the Command property of the ItemTemplate CheckBox to ViewModel object's property?

Let me ask this question with a pseudo code: <Window> <ListView ItemsSource="{Binding PersonCollection}"> <ListView.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Text="{Binding Path=Name}" /> <TextBlock Text="{Binding Path=Age}" /> ...

How to create Item Templates that add more than one file?

I've created an Item Template for VS2008, per these instructions and it seems simple enough. However, is it possible to add more than one file to the project? For instance, let's say I create a AcmeWidget Item Template. When I select it in VS2008, I'd like it to create an AcmeScreen winForm and a AcmeScreenSetup winform. Is this poss...

Repeater within Repeater (ajax based wepapp)

For the solution, I cannot use any postback methods, because this is all working through ajax. The solution need to be implemented in the asp.net code. I have a List<WebPage> that contains a list of Links (List<Link>) and I need for all the links to bind repetitive information such as page title, id, url. Here is my current repeater. <...

Access button in ListBoxItem in Silverlight

Hey everyone. I'm new to Silverlight and would like to access a button control that is part of a ListBoxItem. However, I'm not quite sure how to do this. My XAML is: <DataTemplate x:Key="ItemTemplate2"> <Grid Height="51"> <TextBlock x:Name="tbName" Text="{Binding Property1}" Margin="0,0,98,0" d:LayoutOverride...

add ItemTemplate Manually to create Checkbox column in TemplateField

I am creating the checkbox manually by adding templatefield and , but i cannot able to get the value of Checkbox Checked. my code: TemplateField tf = new TemplateField(); tf.ItemTemplate = new clsMyTemplate(); CheckBox chkCheckBox1 = new CheckBox(); tf.ItemTemplate.InstantiateIn(chkCheckBox1); chkCheckBox1.Checked = (DataBinder....

Control in an ItemTemplate of a ComboBox loses its binding

I have a ComboBox that uses an ItemTemplate as shown below. Somehow the Text property of the text box defined in the item template gets disconnected from the binding and stops being updated when the selected item changes. The ComboBox.ItemsSource is bound to a DependencyProperty that is list of CatheterDefinition objects. The ComboBox...

DataTemplate for ItemTemplate of a Grid displaying its content in columns

I have HeaderedItemsControl which ItemsSource is bound to a ObservableCollection<Person>. I would like to display it's content like: *Name* Müller Schmid Weber *FirstName* Peter Hans Willhelm *Age* 32 56 78 *Country* Switzerland Austria Liechtenstein My xaml-Code so far: <Heade...

ListBox ItemTemplate is fickle with CLR and UserControl data

I wrote a simple UpDown UserControl for my application. I am rendering it in a ListBox so that as UpDown controls get added, they stack up horizontally. My UserControl has one DependencyProperty that corresponds to the number inside of the UpDown control, called NumberProperty. I add multiple UpDown controls to the ListBox via databin...

Checkbox itemtemplate templatefield text after databound

Hello guys, I have the following checkboxes in my gridview: <asp:TemplateField HeaderText="Active"> <ItemTemplate> <%# DataBinder.Eval(Container.DataItem, "Active")%> <asp:CheckBox ID="Active" runat="server"/> </ItemTemplate> </asp:TemplateField> And it working very fine. I'm populating it with a bool value. T...

Display multiple types from a single list in a WPF ListBox?

I'm relatively new to WPF, and it looks like there are probably a bunch of ways to do this, but I can't get any of the ones I have tried to work. I have an ObservableCollection that contains two different types. I want to bind this list to a ListBox and display different DataTemplates for each type encountered. I can't figure out how ...

ListBox Disabled state in Silverlight 4

So I'm styling a ListBox and I've got to the part where I need to do a greyed out style when the ListBox is disabled. However when I look a the states tab in Blend, there's only Validation States present - no sign of the usual Common States which include the Disabled state. I tried creating a vanilla project with no custom styles and ju...

WPF ListView with TreeView as ItemTemplate

Hi, I'm currently trying to create a ListView with a TreeView as ItemTemplate (a list of TreeViews). Furthermore, I need to bind a different XmlDataProvider on each one of them so they can each have a different XML source. I already know how to bind a XML source to a TreeView, but I don't know how to create a XMLDataProvider for each L...

ItemTemplate: ListBox vs ItemsControl

Hi, I'm quite new to the WPF world and I'm having some problems with templating items in an ItemsControl. What I need is to template elements (mostly buttons) inside an ItemsControl (or the like). If I'm using the following XAML code ... <ItemsControl> <ItemsControl.ItemTemplate> <DataTemplate DataType="{x:Type Button}"> ...

Binding with Static properties in ListView ItemTemplate

Hello everyone, I'm having some problems with WPF binding. I have an assembly with some const properties in class Values, that correspond to columns from datatable. I want to bind the value from a column to a TextBlock using the const property to specify the column at a ListView ItemTemplate like shown in the code: xmlns:C="clr-name...

Binding visibility of control inside listbox to a property not contained in the itemsource collection

I have a listbox with a datatemplate that holds a number of controls bound to my collection. I want to bind the visibility of one of the controls to a property defined in the class , an instance of which is set to datacontext in code behind.This property is not a member of collection which is item source of the listbox. How can this be...

Visual studio item template and getting file structure

Hi everyone! I want to build an item template for a project which has the following file structure. Web -> Templates -> Pages Template output will be: namespace Templates.Pages.Foo { [CustomAttribute(Page="~/Templates/Pages/Foo.aspx")] public class Foo { } } I'm having trouble getting file structure. Here's what I ...

How to change appearance of TabItems in a scrolling WPF TabControl?

Hello, I have a scrolling TabControl, using a ScrollViewer and StackPanel (with the StackPanel set as IsItemsHost="true"). To begin with, I am working from a solution originally outlined here - Creating Scrolling Tabs Using WPF's TabControl . At the moment it has broken links (Edit: I have tracked down one instance of his code in a fo...

Silverlight 4 and LisBox's SelectedItem when using DataTemplate as ItemTemplate

Hi All, I'm using tow listboxes for drag n drop where user can drag items from source listbox and drop on the target. I'm using a DataTemplate for the ListBoxItems of my ListBox Controls. I need to give the user ability to move up/down items in the target listbox after they been moved from source. I have two button "Move Up" & "Move ...

WPF Comboxbox within a UserControl - and Item/data templates

Hi All, I have a wpf combobox within a data template and would like the user to set its item / data template. Here is what I have done so far. I have created the user control Add a dependency property and in the code behind file scripted to consume the control. I cannot however get the control to work from the page, the control when d...