Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Separator in ListView (WPF)?

I'm gonna insert a Separator in a ListView in WPF , something like this :
image

I've used the following XAML code, but it dosn't work !

<ListView ItemsSource="{Binding ListViewItemsCollections}">
    <ListView.View>
        <GridView>
            <GridViewColumn Header="Name" Width="200" DisplayMemberBinding="{Binding GridViewColumnName}"/>
            <GridViewColumn Header="Tags" Width="200" DisplayMemberBinding="{Binding GridViewColumnTags}"/>
            <GridViewColumn Header="Location" Width="400" DisplayMemberBinding="{Binding GridViewColumnLication}"/>
        </GridView>
    </ListView.View>
    <Separator />
</ListView>

Could you please guide me ? Thanks.

like image 201
Mohammad Dayyan Avatar asked Jan 13 '10 12:01

Mohammad Dayyan


1 Answers

Mohammad,

I believe inserting a separator (or a control which mimics one) is far more simple than you think :)

First of all, please take a look on how DataTemplate should be applied to a ListBox/ListView. You can find it here. Secondly, you have to decide how you're going to mimic a Separator. You can find 2 excellent examples here and here. Please keep me informed if your task is done :)

like image 140
Piotr Justyna Avatar answered Sep 18 '22 12:09

Piotr Justyna