Click here to Skip to main content
16,006,355 members
Home / Discussions / C#
   

C#

 
Questionnot able to read data from excel sheet using Microsoft.Office.Interop.Excel Pin
PrasannaKulkarni2-Oct-09 4:34
PrasannaKulkarni2-Oct-09 4:34 
AnswerRe: not able to read data from excel sheet using Microsoft.Office.Interop.Excel Pin
Dave Kreskowiak2-Oct-09 5:28
mveDave Kreskowiak2-Oct-09 5:28 
GeneralRe: not able to read data from excel sheet using Microsoft.Office.Interop.Excel Pin
PrasannaKulkarni2-Oct-09 6:19
PrasannaKulkarni2-Oct-09 6:19 
GeneralRe: not able to read data from excel sheet using Microsoft.Office.Interop.Excel Pin
Dave Kreskowiak2-Oct-09 7:05
mveDave Kreskowiak2-Oct-09 7:05 
QuestionCannot convert from system...IList<class> to class[]</class> Pin
Sevententh2-Oct-09 4:09
Sevententh2-Oct-09 4:09 
AnswerRe: Cannot convert from system...IList to class[] Pin
Keith Barrow2-Oct-09 4:19
professionalKeith Barrow2-Oct-09 4:19 
GeneralRe: Cannot convert from system...IList to class[] Pin
Sevententh5-Oct-09 23:27
Sevententh5-Oct-09 23:27 
QuestionOdd behaviour when selecting item in a Combobox [Fixed it, my fault] Pin
Anthony Mushrow2-Oct-09 4:07
professionalAnthony Mushrow2-Oct-09 4:07 
I have a List<MyClass> I use this list to populate a combo box so that the user can select an item from the list, and I can easily grab which one they selected:

onSelectedIndexChanged(...)
{
  this.currentItem = this.comboBox.SelectedItem as MyClass;
}


The strange thing is, when you first select an item from the list, the box doesn't display any text. If you select the same item again, it does.
The box will only display the correct text if you select the same item twice in a row, and everything works as normal when I don't set this.currentItem

Upon further testing it seems to happen when I access properties on the instance of MyClass right after selecting it. If I comment out a bunch of code the combo box works fine, although it's only reading a few values nothing is actually being changed, not that I see how it could make any difference.


Does anybody have any idea what's going on?

EDIT: I know what it was, purely my fault. When an item was selected a numeric up down control was set with a value from that item, this triggered the ValueChanged event, which reset the value back to the item, and triggered Sort on my list, which clears out and refills the combo box with the items in the new order. Bit of a pain in the arse really, I must pay more attention in future D'Oh! | :doh:

My current favourite word is: Delicious!
-SK Genius

Game Programming articles start -here[^]-

modified on Friday, October 2, 2009 10:15 AM

QuestionC# TCP networkstreem problem Pin
Titok Levi2-Oct-09 2:32
Titok Levi2-Oct-09 2:32 
AnswerRe: C# TCP networkstreem problem Pin
Luc Pattyn2-Oct-09 3:06
sitebuilderLuc Pattyn2-Oct-09 3:06 
AnswerRe: C# TCP networkstreem problem Pin
0x3c02-Oct-09 3:56
0x3c02-Oct-09 3:56 
AnswerRe: C# TCP networkstreem problem Pin
Tr@v2-Oct-09 16:26
Tr@v2-Oct-09 16:26 
GeneralRe: C# TCP networkstreem problem Pin
Titok Levi6-Oct-09 22:03
Titok Levi6-Oct-09 22:03 
QuestionGenerics, delegates and type inference Pin
dojohansen2-Oct-09 2:10
dojohansen2-Oct-09 2:10 
AnswerRe: Generics, delegates and type inference Pin
Gideon Engelberth2-Oct-09 6:29
Gideon Engelberth2-Oct-09 6:29 
GeneralRe: Generics, delegates and type inference Pin
dojohansen2-Oct-09 7:43
dojohansen2-Oct-09 7:43 
GeneralRe: Generics, delegates and type inference Pin
Gideon Engelberth2-Oct-09 13:00
Gideon Engelberth2-Oct-09 13:00 
QuestionInheritance question Pin
xkrja1-Oct-09 23:35
xkrja1-Oct-09 23:35 
AnswerRe: Inheritance question Pin
stancrm1-Oct-09 23:49
stancrm1-Oct-09 23:49 
GeneralRe: Inheritance question Pin
xkrja2-Oct-09 0:22
xkrja2-Oct-09 0:22 
GeneralRe: Inheritance question Pin
Mirko19802-Oct-09 0:57
Mirko19802-Oct-09 0:57 
AnswerRe: Inheritance question Pin
Christian Graus2-Oct-09 0:40
protectorChristian Graus2-Oct-09 0:40 
AnswerRe: Inheritance question Pin
DaveyM692-Oct-09 0:46
professionalDaveyM692-Oct-09 0:46 
AnswerRe: Inheritance question Pin
dojohansen3-Oct-09 1:12
dojohansen3-Oct-09 1:12 
QuestionStream System Sound to A GSM MODEM Pin
aghoshbabu1-Oct-09 23:09
aghoshbabu1-Oct-09 23:09 

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.