itemtemplate

Creating a Template Item from a web form and auto generating the Inherits page directive

OK, so I'm trying to create a template item from a web form. I have referenced this article: http://www.west-wind.com/weblog/posts/740022.aspx and it exports the template and installs it fine. When you try and use the template item within a project though it leaves the inherits="_Default" in the page directive like shown below: <%@ Pa...

.Net designer.cs not updated when control is in ItemTemplate

I have a simple form. Let's say one textbox and a button. If these items are placed on the aspx page, they are automatically added to the *.designer.cs file and they can be referenced in my C# code behind. Just like it's supposed to. The problem occurrs when I take these items and place them within an for a FormView control. At that p...

Dynamic (programmaticaly) ItemTemplate (DataTemplate) in Silverlight?

I have this code: <Grid x:Name="LayoutRoot"> <Grid HorizontalAlignment="Left" Height="900" Width="1200"> <Grid.RowDefinitions> <RowDefinition Height="300"></RowDefinition> <RowDefinition Height="200"></RowDefinition> <RowDefinition Height="200"></RowDefinition> </Grid.RowDefinition...

How to use databind records in inline if statements.

Hi everyone, here is my problem: I've got a repeater on my asp.net (VB): <asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("Question_Number") %>' /> <%#Eval("Question_Desc")%> Now what I want to do is, check a value that I haven't used called "Question_Type" whic...

Silverlight ItemsControl vertical scrollbar, using a wrappanel as ControlTemplate

I have a collection of elements, each one with a name and a subcollection of image blobs. I want to display an Accordion, with each item representing each of the MainElements. inside each element, I display the images in the subcollecion of said MainElement. The Accordion gets resized by the user, so I use a wrappanel for presenting the ...

WPF - Very basic ListBox.ItemTemplate Question

Ok, this is an embarassingly simple-looking problem, but is driving me crazy. I'm learning about DataTemplating and am trying to apply a very VERY simple ItemTemplate to a ListBox. However, when I run my app, the template is completely ignored and I just get the standard-looking listbox, whereas in fact I'd expect to see a list of check...

How to determine if an item is the last one in a WPF ItemTemplate?

Hi everyone, I have some XAML <ItemsControl Name="mItemsControl"> <ItemsControl.ItemTemplate> <DataTemplate> <TextBox Text="{Binding Mode=OneWay}" KeyUp="TextBox_KeyUp"/> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> that's bound to a simple ObservableCollection private ObservableCo...

Passing a LINQ DataRow Reference in a GridView's ItemTemplate

SOLVED. Code has been edited to reflect solution. Given the following GridView: <asp:GridView runat="server" ID="GridView1" AutoGenerateColumns="false" DataKeyNames="UniqueID" OnSelectedIndexChanging="GridView1_SelectedIndexChanging" > <Columns> <asp:BoundField HeaderText="Remarks" DataField="Remarks" /> <asp:TemplateFi...

DataTemplate, Style, Triggers

Could you guys help me? I have a with custom and in it: <ListBox> <ListBox.ItemTemplate> <DataTemplate> <Border BorderBrush="Black" BorderThickness="2" CornerRadius="5"> <Image Source="{Binding Picture}" /> </Border> </DataTemplate> </ListBox.ItemTe...

WPF change ItemsPanel and ItemTemplate in code behind

Hi, I have the following list in XAML: <ListView Name="ListViewBack" Margin="3" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsPanel="{StaticResource IconListPanelTemplate}" ItemTemplate="{StaticResource IconListDataTemplate}"> </ListView> Now I would like to be able to change the I...

Strange Behaviour WPF TreeView ItemContainerStyle and ItemTemplate

I just noticed some strange behaviour of WPF's TreeView. I added both ItemContainerStyle to bind to "IsSelected" of my ViewModel and an ItemsTemplated for custom display of my data. But now the user cannot change the selected node anymore. For testing purposes I created a similar UI using ListView and Expander. This version works as exce...

How to add template column to datagrid dynamically

Hi I've my template column like this > <asp:TemplateColumn HeaderText="Name" > SortExpression="Name"> > <ItemTemplate> > <table style="width: 100%"> > <tr> > <td colspan="2"> > <asp:LinkButton ID="lnkbtnname" CssClass="LabelStyleTxt" Width="200px" > runat="server" > Text='<%#Eval("Name") %>' CommandName="ViewL...

ListView GridView and Grid

Hi, If you have a ListView with its view set as a GridView, which itself contains columns for each month say.....how do I set a template up for the ItemTemplate of the ListView so that each Item will be three rows high, and be inline with the ListView.View's columns? For example different employee recruits over a year.... each month acr...

WPF: ListView inside LIstViewItem: How to support button_click

Hi I have problem with using buttons that are placed in the itemtemplate of the listview which is placed in the itemtemplate of the outer listview. I'll try to simplify the code to show only the idea. I have a objects collection which looks like this: Main object contains a list of innerObjects. Every innerObject contains a list of ob...

Changing property of ItemTemplate controls in ListView

I have ListView containig LinkButtons in ItemTemplate. ListView is inside UpdatePanel so it is not doing page refresh. When users click on one the LinkButtons it changes its css property in order to mark the selection: protected void ListView1_ItemCommand1(object sender, ListViewCommandEventArgs e) { ((LinkButton)e.C...

Scrolling list items in wpf

I guess the following picture depicts the problem better than texts... That is what I need. <ListBox x:Name="NamesListBox" ItemsSource="{Binding}"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <WrapPanel x:Name="ItemWrapPanel"> <WrapPanel.RenderTransform> <TranslateTransform ...

WPF: How can I KEEP the same ItemTemplate instance once its created ??

Hello, Here is a cinario: I have a ListView, with ItemsSource = ProjectModel.Instance.PagesModelsCollection; where PagesModelsCollection is an ObservableCollection In the ListView XAML part: <ListView.ItemTemplate> <DataTemplate x:Name="PagesViewDataTemplate"> <DataTemplate.Resources> ...

Gridview item template refresh

<asp:TemplateField HeaderText="Quantity" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"> <ItemTemplate> <%#GetQuantityRemaining((int) Eval("Id")) %> </ItemTemplate> <HeaderStyle HorizontalAlign="Left"></HeaderStyle> <ItemStyle HorizontalAlign="Left"></ItemStyle> </asp:TemplateField> E...

How to Access a Control present inside a DataTemplate

Hi, I have Few TextBlock inside the Data template as follow: <DataTemplate> <StackPanel x:Name="stackPanelItems" Orientation="Horizontal"> <TextBlock x:Name="myTextBox" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="14" /> </StackPanel> </DataTemplate> Now we need to Make the myTextBox Collsapsed...

How to find the one Label in DataList that is set to True

In my .aspx page I have my DataList: <asp:DataList ID="DataList1" runat="server" DataKeyField="ProductSID" DataSourceID="SqlDataSource1" onitemcreated="DataList1_ItemCreated" RepeatColumns="3" RepeatDirection="Horizontal" Width="1112px"> <ItemTemplate> ProductSID: <asp:Label ID="ProductSIDLabel" runat="ser...