Abhilash J A

Abhilash J A

  • 530
  • 2.4k
  • 600.5k

prevent listview row click checkbox checked wpf

Dec 23 2016 7:01 AM
Hello,
 
I have listview with contain Checkbox. I want to privent checkbox checked when click on listview row only allow on checkbox click.
 
  1. <GridViewColumn>  
  2.                                             <GridViewColumn.CellTemplate>  
  3.                                                 <DataTemplate>  
  4.                                                     <CheckBox Tag="{Binding UserId}" IsChecked="{Binding RelativeSource={RelativeSource AncestorType=ListViewItem},Path=IsSelected}" />  
  5.                                                 </DataTemplate>  
  6.                                             </GridViewColumn.CellTemplate>  
  7.                                         </GridViewColumn >  
  1. public partial class UC_FileMgmt : UserControl  
  2.     {  
  3.         public UC_FileMgmt()  
  4.         {  
  5.             InitializeComponent();  
  6.             DMSBusinessLayer service = new DMSBusinessLayer();             
  7.             listView1.ItemsSource = service.GetUserDocuments();  
  8. }  
  9. }  
 How can I do this?

Answers (1)