Click here to Skip to main content
15,889,266 members
Home / Discussions / C#
   

C#

 
AnswerRe: Coding Standard Question Pin
Scott Dorman1-Oct-07 15:50
professionalScott Dorman1-Oct-07 15:50 
GeneralRe: Coding Standard Question Pin
PIEBALDconsult1-Oct-07 16:56
mvePIEBALDconsult1-Oct-07 16:56 
JokeRe: Coding Standard Question Pin
Pete O'Hanlon1-Oct-07 21:59
mvePete O'Hanlon1-Oct-07 21:59 
GeneralRe: Coding Standard Question Pin
Scott Dorman2-Oct-07 2:59
professionalScott Dorman2-Oct-07 2:59 
GeneralRe: Coding Standard Question Pin
Robert Rohde2-Oct-07 1:55
Robert Rohde2-Oct-07 1:55 
GeneralRe: Coding Standard Question Pin
Scott Dorman2-Oct-07 3:01
professionalScott Dorman2-Oct-07 3:01 
GeneralRe: Coding Standard Question Pin
PIEBALDconsult2-Oct-07 5:41
mvePIEBALDconsult2-Oct-07 5:41 
QuestionSelecting listview item by method not retained when tabbing into listview Pin
jchalfant1-Oct-07 9:30
jchalfant1-Oct-07 9:30 
So I wrote a clever little search tool for my list view that searches through all the items as you type. The Item.Select() and Item.EnsureVisible() work fine at runtime until I decide to TAB into the listview. At which point if I try browsing the listview using the arrow keys, I start browsing from the Item that was selected BEFORE I did my search.

Here's the basic gist of my search:
for(int i = 0; i < listView1.Items.Count;i++)<br />
{<br />
                if (itemContains(targetstring, (ListViewItem)listView1.Items[i].Clone()))<br />
                {<br />
                    listView1.Items[i].Selected = true;<br />
                    listView1.Items[i].EnsureVisible();<br />
                    return;<br />
                }<br />
}


I've tried unselecting the previous selected item when a valid item was found, but that didn't seem to work. When I output SelectedItems[0].ToString() it output the correct Item. It's only when I gain focus to the listview using TAB that it treats the last item selected by mouse click as the selected item.

Any ideas here? It'd be much appreciated.

-J.Chalfant
AnswerRe: Selecting listview item by method not retained when tabbing into listview Pin
jchalfant1-Oct-07 9:59
jchalfant1-Oct-07 9:59 
Questioncalling modeless lookup form from datagridview combobox Pin
AndrusM1-Oct-07 9:29
AndrusM1-Oct-07 9:29 
QuestionInsert a row in Gridview Pin
ss.mmm1-Oct-07 9:24
ss.mmm1-Oct-07 9:24 
AnswerRe: Insert a row in Gridview Pin
Not Active1-Oct-07 9:46
mentorNot Active1-Oct-07 9:46 
GeneralRe: Insert a row in Gridview Pin
ss.mmm1-Oct-07 9:55
ss.mmm1-Oct-07 9:55 
GeneralRe: Insert a row in Gridview Pin
Not Active1-Oct-07 10:05
mentorNot Active1-Oct-07 10:05 
GeneralRe: Insert a row in Gridview Pin
DotNetXenon1-Oct-07 10:12
DotNetXenon1-Oct-07 10:12 
GeneralRe: Insert a row in Gridview Pin
ss.mmm15-Oct-07 8:28
ss.mmm15-Oct-07 8:28 
QuestionUniversal Toolbox Item installation help Pin
Jason Farrar1-Oct-07 9:06
Jason Farrar1-Oct-07 9:06 
AnswerRe: Universal Toolbox Item installation help Pin
TJoe1-Oct-07 13:10
TJoe1-Oct-07 13:10 
QuestionMSMQ Triggers Pin
Not Active1-Oct-07 9:06
mentorNot Active1-Oct-07 9:06 
AnswerRe: MSMQ Triggers Pin
led mike1-Oct-07 9:25
led mike1-Oct-07 9:25 
GeneralRe: MSMQ Triggers Pin
Not Active1-Oct-07 9:42
mentorNot Active1-Oct-07 9:42 
AnswerRe: MSMQ Triggers Pin
Pete O'Hanlon1-Oct-07 9:43
mvePete O'Hanlon1-Oct-07 9:43 
GeneralRe: MSMQ Triggers Pin
Not Active1-Oct-07 9:50
mentorNot Active1-Oct-07 9:50 
GeneralRe: MSMQ Triggers Pin
Pete O'Hanlon1-Oct-07 9:58
mvePete O'Hanlon1-Oct-07 9:58 
QuestionOverloading comparisson operator Pin
Fernando A. Gomez F.1-Oct-07 8:31
Fernando A. Gomez F.1-Oct-07 8:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.