Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I put a header on the ItemsControl?
    primarykey
    data
    text
    <p>I want to show a product list with a header like a DataGrid. But I don't know how to show heading in the listbox.</p> <pre><code>&lt;ListBox ItemsSource="{Binding CustomSalesProducts, Mode=TwoWay}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Template="{DynamicResource ListBox}" Style="{DynamicResource ListBoxStyle1}" BorderBrush="{DynamicResource BorderBrush}" Foreground="{DynamicResource ForegroundBrush}" FontFamily="Palatino Linotype" FontSize="13.333" ItemContainerStyle="{DynamicResource ListBoxItemStyle}" SelectedValue="{Binding CurrentCustomSale, Mode=TwoWay}"&gt; &lt;ItemsControl.ItemsPanel&gt; &lt;ItemsPanelTemplate&gt; &lt;VirtualizingStackPanel CanHorizontallyScroll="True" CanVerticallyScroll="True" Orientation="Vertical"/&gt; &lt;/ItemsPanelTemplate&gt; &lt;/ItemsControl.ItemsPanel&gt; &lt;ItemsControl.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;StackPanel&gt; &lt;StackPanel Orientation="Horizontal"&gt; &lt;TextBox Text="{Binding ProductName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="{StaticResource Margin4}" Style="{DynamicResource MiniTextBoxStyle}" ToolTip="Quantity" KeyUp="TextBox_KeyUp"/&gt; &lt;TextBox Text="{Binding OrderQty, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="{StaticResource Margin4}" Style="{DynamicResource MiniTextBoxStyle}" ToolTip="Quantity" KeyUp="TextBox_KeyUp"&gt; &lt;/TextBox&gt; &lt;TextBox Text="{Binding UnitSalePrice, Mode=TwoWay}" Style="{DynamicResource MiniTextBoxStyle}" Margin="{StaticResource Margin4}" ToolTip="Price" IsReadOnly="True" /&gt; &lt;TextBox Text="{Binding MainDiscount, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="{StaticResource Margin4}" Style="{DynamicResource MiniTextBoxStyle}" ToolTip="Discount" KeyUp="TextBox_KeyUp"/&gt; &lt;TextBox Text="{Binding Discount, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="{StaticResource Margin4}" IsReadOnly="True" Style="{DynamicResource MiniTextBoxStyle}" ToolTip="Line Discount" KeyUp="TextBox_KeyUp"/&gt; &lt;TextBox Text="{Binding TaxAmount, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="{StaticResource Margin4}" Style="{DynamicResource MiniTextBoxStyle}" ToolTip="Tax Amount" IsReadOnly="True" /&gt; &lt;TextBox Text="{Binding LineTotal, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="{StaticResource Margin4}" Style="{DynamicResource MiniTextBoxStyle}" ToolTip="Total" IsReadOnly="True" /&gt; &lt;/StackPanel&gt; &lt;/StackPanel&gt; &lt;/DataTemplate&gt; &lt;/ItemsControl.ItemTemplate&gt; &lt;/ListBox&gt; </code></pre> <p>I want this kind of output</p> <pre><code>-------------------------------------- ID Name Price Discount 1 xxxx 1245 8 2 xxxxxxxx 4354 9 ..... and so on.. </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload