title: wpf listview drag select multiple items with cltrl+left mouse over and selection mode is extended
body: <p>My requirement is : I have a list view in wpf user control and selection mode is extended. User can selects different ways those are:
  1. with shift key
  2. with ctrl key
  3. with ctrl+left mouse button and drag select.</p>
  
  <p>First and second scenario is working for me. How to achieve the 3 scenario.</p>
  
  <p>I have gone through last answer which is in the below link. But it did not worked for me.</p>
  
  <p><a href="https://stackoverflow.com/questions/2869566/wpf-listview-drag-select-multiple-items/34202163#34202163">Previous Post</a></p>
  
  <p>Please help to fix the issue.</p>
  
  <p>Here is my listview: </p>
  
  <pre><code>&lt;ListView BorderThickness="0,0,0,1"                   
                Name="WheeledYardLocation"
                ItemsSource="{Binding lstUser}"
                SelectionMode="Extended"
                HorizontalAlignment="Stretch"
                AutomationProperties.Name="WheeledListView"
                AutomationProperties.AutomationId="WheeledListView"
                SelectedIndex="0"
                AlternationCount="2"&gt;
          &lt;ListView.ItemContainerStyle&gt;
              &lt;Style TargetType="ListViewItem"&gt;                   
                  &lt;Setter Property="Template"&gt;
                      &lt;Setter.Value&gt;
                          &lt;ControlTemplate TargetType="{x:Type ListViewItem}"&gt;
                              &lt;Border Name="root"
                                      Background="Transparent"
                                      BorderThickness="0,0,0,1"
                                      HorizontalAlignment="{TemplateBinding HorizontalAlignment}"&gt;                                   
                                  &lt;Grid Margin="10,2,0,2"
                                        HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                                        Background="Transparent"&gt;
                                      &lt;Grid.ColumnDefinitions&gt;
                                          &lt;ColumnDefinition Width="*" /&gt;
                                          &lt;ColumnDefinition Width="50" /&gt;
                                      &lt;/Grid.ColumnDefinitions&gt;
                                      &lt;TextBlock Name="title"
                                                 FontSize="14"&gt;
                                          &lt;TextBlock.Text&gt;
                                              &lt;MultiBinding StringFormat=" {0}-{1}"&gt;
                                                  &lt;Binding Path="Id" /&gt;
                                                  &lt;Binding Path="Name" /&gt;
                                              &lt;/MultiBinding &gt;
                                          &lt;/TextBlock.Text&gt;
                                          &lt;AutomationProperties.AutomationId&gt;
                                              &lt;MultiBinding StringFormat="Block-{0}"&gt;
                                                  &lt;Binding Path="Age" /&gt;
                                              &lt;/MultiBinding &gt;
                                          &lt;/AutomationProperties.AutomationId&gt;
                                      &lt;/TextBlock&gt;
                                      &lt;TextBlock Name="total"
                                                 Grid.Column="1"
                                                 HorizontalAlignment="Center"&gt;
                                          &lt;AutomationProperties.AutomationId&gt;
                                              &lt;MultiBinding StringFormat="TotalAvailable-{0}"&gt;
                                                  &lt;Binding Path="Age" /&gt;
                                              &lt;/MultiBinding &gt;
                                          &lt;/AutomationProperties.AutomationId&gt;
                                          &lt;Run Text="{Binding Path=Age,  StringFormat=0;;-}" /&gt;
                                      &lt;/TextBlock&gt;
                                  &lt;/Grid&gt;
                              &lt;/Border&gt;
                              &lt;ControlTemplate.Triggers&gt;
                                  &lt;Trigger Property="IsMouseOver"
                                           Value="True"&gt;
                                      &lt;Setter Property="Background"
                                              Value="Blue"
                                              TargetName="root" /&gt;
                                      &lt;Setter Property="Foreground"
                                              Value="White"
                                              TargetName="title" /&gt;
                                      &lt;Setter Property="Foreground"
                                              Value="White"
                                              TargetName="total" /&gt;                                        
                                  &lt;/Trigger&gt;
                                  &lt;Trigger Property="IsSelected"
                                           Value="True"&gt;
                                      &lt;Setter Property="Background"
                                              Value="Blue"
                                              TargetName="root" /&gt;
                                      &lt;Setter Property="Foreground"
                                              Value="White"
                                              TargetName="title" /&gt;
                                      &lt;Setter Property="Foreground"
                                              Value="White"
                                              TargetName="total" /&gt;
                                  &lt;/Trigger&gt;
                              &lt;/ControlTemplate.Triggers&gt;
                          &lt;/ControlTemplate&gt;
                      &lt;/Setter.Value&gt;
                  &lt;/Setter&gt;                    
              &lt;/Style&gt;
          &lt;/ListView.ItemContainerStyle&gt;
      &lt;/ListView&gt;
  </code></pre>