ListView and ListViewItem : ListView « Windows Presentation Foundation « C# / C Sharp






ListView and ListViewItem

ListView and ListViewItem
   

<Window x:Class="SimpleStyles.Window1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="SimpleStyles"
  Background="#F8F8F8">
  <ScrollViewer>
    <WrapPanel>
      <HeaderedItemsControl Header="ListView">
        <StackPanel>
          <ListView Margin="8" Height="100" Width="150">
            <ListView.View>
              <GridView AllowsColumnReorder="true">
                <GridViewColumn DisplayMemberBinding="{Binding}" Header="Content" Width="100"/>
                <GridViewColumn DisplayMemberBinding="{Binding Path=Length}" Header="Length" Width="100"/>
              </GridView>
            </ListView.View>
            <ListViewItem Content="First Item" />
            <ListViewItem Content="Second Item" />
            <ListViewItem Content="Third Item" />
            <ListViewItem Content="Fourth Item" />
            <ListViewItem Content="Fifth Item" />
            <ListViewItem Content="Sixth Item" />
            <ListViewItem Content="Seventh Item" />
            <ListViewItem Content="Eighth Item" />
          </ListView>
        </StackPanel>
      </HeaderedItemsControl>
   
    </WrapPanel>
  </ScrollViewer>
</Window>

   
    
    
  








Related examples in the same category

1.Create a ListView control that implements a GridView view with CheckBox controls for each row.Create a ListView control that implements a GridView view with CheckBox controls for each row.
2.Use ArrayList as the ListView ItemSourceUse ArrayList as the ListView ItemSource
3.Create a ListView control that implements a GridView view mode, displays content in groups.Create a ListView control that implements a GridView view mode, displays content in groups.
4.ListView columnsListView columns
5.Populating ListView rowsPopulating ListView rows
6.Set Binding ListView.ItemsSourceProperty to ListViewSet Binding ListView.ItemsSourceProperty to ListView
7.Create a ListView control that uses a GridView view mode to display a collection of DateTime objects.Create a ListView control that uses a GridView view mode to display a collection of DateTime objects.
8.ListView using GridView.HeaderTemplate and GridViewColumn.CellTemplate propertiesListView using GridView.HeaderTemplate and GridViewColumn.CellTemplate properties
9.Get Bounded item from ListViewGet Bounded item from ListView
10.Create Binding for ListView in codeCreate Binding for ListView in code
11.Use three TextBlocks in one ListViewItemUse three TextBlocks in one ListViewItem
12.Create a ListView control that uses a GridView view mode to display dates.Create a ListView control that uses a GridView view mode to display dates.
13.Use Path to reference Bounded object in ItemSourceUse Path to reference Bounded object in ItemSource
14.Enables sorting of data in ascending or descending order according to the contents of one column.Enables sorting of data in ascending or descending order according to the contents of one column.