wpf - shift+click couldn't select correct items with listview -


In my list view, I press ctrl + a to select all the items and select several items with the shift button. But this does not work, I use the keybinding to rewrite all the commands, but how to select multiple items with the shift button?

XAML:

  & lt; ListView VirtualizingPanel.IsVirtualizing = "True" VirtualizingPanel.VirtualizationMode = "Recycling" ItemSource = "{Binding Test List}" SelectionMode = "Extended" & gt; & Lt; ListView.ItemTemplate & gt; & Lt; DataTemplate & gt; & Lt; Text block text = "{binding test content}" /> & Lt; / DataTemplate & gt; & Lt; /ListView.ItemTemplate> & Lt; ListView.InputBindings & gt; & Lt; Key binding command = "{binding selection all command}" modifier = "control" key = "a" /> & Lt; /ListView.InputBindings> & Lt; ListView.ItemContainerStyle & gt; & Lt; Style TargetType = "ListViewItem" & gt; & Lt; Setter Property = "Selected" value = "{Compulsive Selection, Mode = Dova}" /> & Lt; / Style & gt; & Lt; /ListView.ItemContainerStyle> & Lt; / ListView & gt;   

Main View Model:

  Public Sector Main View Model {Public ICMAM & Eclalled Commands {Protected Set; get; } Public Main View Model () {SelectAllCommand = New DelegateCommand (ExecuteSelect AllCommand); TestList = new list & lt; Test & gt; (); InitializeList (); } Private Zero ExecuteSelectAllCommand () {foreach (in v.TestList) {v.Iselected = true; }} Private Zero initial list () {for (int i = 0; i & lt; 500; i ++) {this.TestList.Add (New Test) (TestContent = i.ToString (), IsSelected = false}) ; }} Public listing & lt; Test & gt; Get TestList { Set; }}   

Test class:

  Public class test: notification object {public string test content (get)); Set; } Private bool is selected; Public Child iCalize (get {return is selected}; set {if (selected! = Value) {is selected = value; RaisePropertyChanged ("IsSelected");}}}}   

Since my actual list view will load items from the server, there may be a large number of items, so I have to use the virtualization panel.

Any help

If you are going to bind then you need to use a behavior SelectedItems For the visualization panel for obvious reasons: If the item does not need to be loaded, then it does not exist.

I took part in this problem and sent telereal users to my RadGridView < Using an approach to use with / code>.

You can find that approach

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -