Click here to Skip to main content
15,895,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a ListView Control, I need the checkbox add in the listView。
Posted

I do not know if you have found the best solution, but think this sample will give you some help

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
    <ListView>
      <ListView.View>
        <GridView>
          <GridViewColumn Width="120" Header="Date" >
            <GridViewColumn.CellTemplate>
              <DataTemplate>
                <StackPanel>
                  <CheckBox/>
                </StackPanel>
              </DataTemplate>
            </GridViewColumn.CellTemplate>
          </GridViewColumn>
          <GridViewColumn Width="120" Header="Day Of Week"  
            DisplayMemberBinding="{Binding DayOfWeek}" />
          <GridViewColumn Width="120" Header="Year" 
           DisplayMemberBinding="{Binding Year}" />
        </GridView>
      </ListView.View>
    </ListView>
  </Grid>
</Window>
 
Share this answer
 
You can try these links. There are almost 96,000 results that may be able to help you.
 
Share this answer
 
Comments
Espen Harlinn 11-Jan-11 10:21am    
5+ First result is Multiselect ListView with checkboxes in WPF
I doesn't get much simpler than this:
Multiselect ListView with checkboxes in WPF[^]

Regards
Espen Harlinn
 
Share this answer
 
Number 1 result from google search for "wpf listview checkbox" is this[^]. Does that help?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900