List box selected Index event
Posted on 2007-12-05
My question is :
I have a console screen....which accepts user info ,when I enter userfirstname/lastname and click on a search button names related to that type will appear in the datagrid view ..for suppose I have a firstname called dave then users with first name dave will come in the datagrid view .....it might be any number of rows....If I select the first row all that users information is displayed ....I mean his billing address,personal details and the products he registere....so now the products he registered would come up through datasource and are populated in the list box.....
Now the problem:
First time when I select a user /row it populates his products in list box and the control is not highlighted as the code runs through listbox1.selectedindex=-1
second time when I click the row in datagridview control automatically hits the first name in the lsit box and reads the information without even selecting the name............the information inside that is popped up through a msg box.........now when I click on ok in the msg box...........then its going through listbox.selectedindex=-1 and does not highlight any thing...........
I want a work around to solve this .