itemtemplate

String was not recognized as a valid Boolean when added to visible attribute

梦想与她 提交于 2019-12-07 04:11:56
问题 I'm trying to add a true or false Visible attribute to my listview itemtemplate table. What I did is that I have a hiddenfield that is set at page load so that I can make a specific column visible or not. This is my hiddenfield and column: Hidden Field <asp:HiddenField ID="uoHiddenFieldPriority" runat="server" Value="false" /> Td column <td class="leftAligned" visible='<%# (Convert.ToBoolean(uoHiddenFieldPriority.Value)) %>' > some Text </td> This is my code in the backend: int visibility = 0

MvvmCross : dynamic item template selection for MvxListView

久未见 提交于 2019-12-07 04:10:38
问题 If I have a view with the following MvxListView definition: <Mvx.MvxListView android:layout_marginTop="10px" android:textFilterEnabled="true" android:choiceMode="singleChoice" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textSize="20dp" local:MvxBind="ItemsSource Data; ItemClick LaunchCapabilityViewCmd" local:MvxItemTemplate="@layout/itemtemplate1" /> Instead of hard coding MvxItemTemplate to itemtemplate1, it it possible to dynamically set this based on the

Binding inside listbox itemtemplate problems

大憨熊 提交于 2019-12-06 08:17:00
问题 I have two separate binding problems with listboxes with an itemtemplate which contains a texbox. 1) One listbox binds to a list of strings. How can I display each string inside the textboxes created and allow two way binding at the same time? Two way binding isn't allowed without specifying a Path or XPath. <ListBox Height="231" HorizontalAlignment="Left" Margin="0,167,0,0" Name="listBoxKeys" VerticalAlignment="Top" Width="219" ItemsSource="{Binding Path=SelectedPlatform.Keys}" SelectedItem=

Wrap something around each item in an ItemsControl

岁酱吖の 提交于 2019-12-06 02:52:18
问题 Let's say I have a collection of objects of different classes. Each class has its UserControl DataTemplated in a resource file. Now I want to use ItemsControl to display the collection, but I want an Border or Expander around each item. I would expect something like this to work: <ItemsControl ItemsSource="{Binding MyObjects}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate>

DataTemplate for a DataType - how to override this DataTemplate in a particular ListBox?

雨燕双飞 提交于 2019-12-05 21:36:29
I have created several DataTemplates for some of the DataTypes in my pet project. These data templates are really cool as they work like magic, magically transforming the look of the instances of the data types whenever and wherever they show up in the UI. Now I want to be able to change the DataTemplate for these DataTypes in one particular ListBox. Does this mean I have to stop relying on WPF automatically applying the data template to the data types and assign a x:Key to the DataTemplates and then apply the Template/ItemTemplate in the UI using that key? A ListBox contains items of various

ComboBox with ItemTemplate that includes a button

扶醉桌前 提交于 2019-12-05 18:25:32
So, lets say I have a ComboBox with a custom data template. One of the items in the data template is a button: <ComboBox Width="150" ItemsSource="{Binding MyItems}"> <ComboBox.ItemTemplate> <DataTemplate> <Button Content="ClickMe" /> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> The problem with this is that the button eats the click, and the item does not get selected if the button is selected. This means that the pull-down does not go away, and no item is selected. I get WHY this is happening. Is there a way to work around it? Possibly a way to process the button click (I am binding

Windows 8 XAML ListView with Header and Item Template columns should have same dynamic width

主宰稳场 提交于 2019-12-05 10:45:44
I am using a Listview with an Itemtemplate and a Headertemplate. Both templates contain 6 Columns. Everything is ok if i set a fixed column width for the templates - like in figure one. But i want to set the width to "Auto" for the items - but then i get figure 2... How to handle this? Is it possible to set the Header Column width with c#? - or any other solution? Figure 1: Figure 2: Code Listview: <ListView x:Name="DayanalyseListView" HorizontalAlignment="Center" VerticalAlignment="Top" ItemTemplate="{StaticResource DataTemplate}" HeaderTemplate="{StaticResource HeaderTemplate}"> </ListView>

How to group ListBoxItems by first letter in WPF using XAML?

末鹿安然 提交于 2019-12-04 22:54:58
问题 First, here is the previous post that deals with the ListBox AccountListBox data binding to my ObservableCollection<Account> Accounts from the AccountsCollection.cs class. So now I have a binding object AccountsCollection and a DataTemplate named AccountTemplate for my ListBox defined in the resources: <Window.Resources> <controller:AccountsWindowController x:Key="AccountsCollection" /> <DataTemplate x:Key="AccountTemplate"> <DockPanel> <Button Name="EditButton" DockPanel.Dock="Right" Margin=

bind database image to ItemTemplate in .ascx

此生再无相见时 提交于 2019-12-04 06:17:04
问题 I am using dynamic ItemTemplate for ListView which populated from database.Here is how I do when I need to display string column "Parametr" (or some other datatypes): //my .ascx file <li><%# Eval("Parametr") %> </li> How can I display varbinary column that stores images?Thanks. EDIT: Here is some more code if somebody needed: <asp:ListView ... DataSourceID="database" ></asp:ListView> <asp:SqlDataSource ... ID="database" SelectCommand="SELECT image FROM image_table"></asp:SqlDataSource> 回答1:

How to group ListBoxItems by first letter in WPF using XAML?

妖精的绣舞 提交于 2019-12-03 14:29:47
First, here is the previous post that deals with the ListBox AccountListBox data binding to my ObservableCollection<Account> Accounts from the AccountsCollection.cs class. So now I have a binding object AccountsCollection and a DataTemplate named AccountTemplate for my ListBox defined in the resources: <Window.Resources> <controller:AccountsWindowController x:Key="AccountsCollection" /> <DataTemplate x:Key="AccountTemplate"> <DockPanel> <Button Name="EditButton" DockPanel.Dock="Right" Margin="3 0 3 0" VerticalAlignment="Center" Content="Edit" /> <Button Name="DeleteButton" DockPanel.Dock=