I have a ListView with several columns, let's say column A,B,C,D in that order, sorted by column A. In long lists I could press a letter on my keyboard and scroll down to the first item in column A开发者_高级运维 that begins with the letter pressed.
A new column has been inserted at the beginning, yet I still want to be able to press a letter on my keyboard and scroll according to the values in column A which is now the second column. How can I set the focus back to column A without making it the first column?
Matching on keystrokes always happen on the first column, that is on the column with Index
= 0. If your new column (call it column E) is now the first column, text matching will occur on it.
You can change the display order of the columns, so that column E simply appears before column A, by playing with the DisplayIndex
property on the column.
So, to make column E appear as the first column and column A appear as the second column, AND for text searching to work on column A, you need to set the properties like this:
column A: Index = 0 DisplayIndex = 1
column E: Index = 1 /* or 5 or whatever */ DisplayIndex = 0
精彩评论