itemtemplate

Databinding a List to a usercontrol in an Item Template in codebehind

I have a DataList like below: <asp:DataList runat="server" ID="myDataList"> <ItemTemplate> <uc:MyControl ID="id1" runat="server" PublicProperty='<%# Container.DataItem %>' /> </ItemTemplate> </asp:DataList> The Item Template is simply a registered usercontrol, MyControl. The DataSource for the DataList is a List<List<T>> a...

adding logic to datagrid item template

Dear All, how would you go about adding logic to a datagrid item template? In my datagrid, i want to add a logic to it. that is, if the result for the data equals to "Yes", an "asp:label" control will be displayed; otherwise a "asp:imagebutton" control will be shown <ItemTemplate1> <% if DataBinder.Eval(Container.DataItem, "boflag").e...

s:ScatterView ItemTemplate - how to set height or width?

I have a small problem while working on software for a Surface: I have a binded ScatterView and its items have a DataTemplate. My question is : how do I set the width and height of the ScatterViewItem that it is created from the ItemTemplate? <s:ScatterView Name="svMain" Loaded="svMain_Loaded" ItemsSource="{Binding BallsCollection...

ASP.NET GridView ItemTemplate

OK I have a GridView and there is a column that I want to be a link if a file exists, otherwise I just want it to be a label. Right now I am changing the controls on RowDataBound event handler using the Row passed in the args. I am not a big fan of this as I am hard coding the column ID, and if it ever changes I will need to remember t...

How can I create an ItemsControl that renders each "item" as a point on a PolyLine?

I'm very confused by the MSDN samples. And all the samples I find generally revolve around text items in a StackPanel or something similarly simple. Given an array of numbers as the ItemsSource - ItemsSource = { 25 , 50 , 75 } the ItemsControl should procuce only this: <PolyLine Points="0,25 1,50 2,75" /> As shown, each item...

Is it possible to prompt the user for information in a Visual Studio template?

Is it possible to prompt the user for more than just a file name when they create a new item from a Visual Studio 2005 template? It would be nice to have more than just the class's name filled in when a template is used. ...

Any way to modify existing files in a Visual Studio Template?

I'm currently using a "New Item" template of mine to create several classes in my project based on the Name entered. What I'd like to be able to do, is to also add some lines to an existing file in the project. Is there any way to do this? Is there any way to run some sort of script from within the .vstemplate file? ...

Problem with ItemTemplate TextBlock

Hi, i am trying to make an item template where some of the field in my stack panel can be empty. When it's empty, I would like to set the visiblility to collapsed. I tried putting triggers but it doesn't seem to work and I am not very familiar with this part of WPF Also, I would like to change the color of the background of this item w...

Itemtemplate to view Picture in Asp Datagrid (in code)

I´m writing on a webpart for sharepoint, so I have to generate a Datagrid problematically. The Situation is that I get a Dataview, generate the Gris and bind the Data. One column should show a Image, so I have to generate a template column with item template. So code looks like this: //Instantiate the DataGrid, and set the DataSource ...

SelectionChanged not triggered when using ItemTemplate in Silverlight 3 ComboBox

I'm experiencing som strange behaviour by the Silverlight ComboBox. I started out with some simple code: xaml: <ComboBox Name="drpInstallation" SelectionChanged="drpInstallation_SelectionChanged" /> cs: List<string> installations = new List<string>(); installations.Add("Testing 123"); installations.Add("Antoher test"); installation...

Data-bound UserControl in ListBox.ItemTemplate

I have a simple class Product and a UserControl named ProductSummaryControl. ProductSummaryControl displays the details for a Product class that is passed in to its DataContext. I have verified that this works when I set up the control and its property manually. I run into a problem when I try to use the ProductSummaryControl as part ...

listbox itemtemplate for selected item

Hi I am using Listbox with ItemTemplate, and when I select an item from the list, it shows blue background How can I style the selected item, to be similar to non-selected one? ...

Databinding ObjectDataSource inner List<T> property with Gridview

Hi Everyone, I have a Nhibernate Repository which I use with a Object DataSource to bind Job Objects (shown below) to various controls on a Asp.Net page. So far I've not had any problems binding, until I wanted to bind the inner IList of Tasks contained in the Job Object: Specifically I want to bind the Tasks list to a Gridview, So ...

Events from UserControl as ItemTemplate in WPF ListBox

In WPF, I have a ListBox with a UserControl as its ItemTemplate - all data shown ok. I have now added a text box for input in that user control. In an MVVM design, I want to take some action (re-calculate values) in the main window when the user edits the content of the text box in the user control, in the item template, in the list box....

asp.net ItemTemplate : ITemplate

public class TheItemTemplate : ITemplate { //.... public void InstantiateIn(Control container) { //... } } Who calls this method? And when is it called? ...

How can I get alternate styling in <ItemTemplate> (.NET)?

I'm using EPiServer for this website. Unlike asp:DataList, EPiServer:PAgeList does not have AlternatingItemTemplate. So I need to create a counter and increase this counter in my <ItemTemplate>, and then use modulus to return whuch css style to append to article / page. Modulus "code" - fromcode behind: return index % 2 == 0 ? "style...

Conditional Item Templates with RadComboBox

I have a RadComboBox that I am using to display department name and abbreviations. I am using an Item Template with a LinqDataSource to make each item appear as: DeptAbbr - (DeptName) Here is the code I am using to do this and it works fine: <telerik:RadComboBox ID="rcbDepartments" runat="server" AppendDataBoundItems="True" O...

create itemtemplate dynamically in grid view on asp.net page

Hi all, I want to add 5 Templte fileds with Item template with Different type of controls . want kind of code on server side. means dynamically as follows //GridView here ', 'one');"> " alt="Click to show/hide Orders for Customer <%# Eval("C...

ListView not updating after RaiseCanExecuteChanged is called

I have a ListView that is bound to a collection of view models. The Item template contains a button that is bound to a command on the view model. When I set the property that the ItemsSource of the ListView I call RaiseCanExecuteChanged for each viewmodel. public BindingList<IVehicleViewModel> Vehicles { get { return _vehic...

WPF: Simplest ItemControl will not display any items

I can't get the simplest idea of an ItemControl to work. I just want to populate my ItemsControl with a bunch of SomeItem. This is the code-behind: using System.Collections.ObjectModel; using System.Windows; namespace Hax { public partial class MainWindow : Window { public class SomeItem { public ...