I have a ListView control on a form. The control's View is "Detail". I am using netsted class ( I named it ListViewItemComparer ) to sort ListView control to use with its "ListViewItemSorter" property and "Sort" method.
The PROBLEM is when I click on column to sort, it works fine; BUT to browse the ListViewControl I have to use mouse ONCE. Without using mouse, browsing of ListView control is not possible with Keyboard like first alphabet of a item, arrow keys (except DOWN arrow key, which moves conrol to first item in ListView control).
So the requirement is, user can click on column-header to sort the column user can use keyboard to select item in ListView control.
Thanks in advance
The code is written below and the simple project also is ATTACHED with this message.
The code :
VB Code:
Public Class Form1
Inherits System.Windows.Forms.Form
Dim sortColumn As Integer = -1
'Region " Windows Form Designer generated code (Removed)"
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Yeah, all my little code snip does is just select and focus the first listviewitem if NO listviewitem is selected (SelectedItems.Count = 0). If I remember right, when no item is selected then keyboard navigation doesn't happen.
If you have an item selected already then my code won't change selection.