Help With a Combo Problem
-
Your core problem is that you're shoving a datarowview into the value, the problem really is when you set the data source. You need to tell the combo which property to use to set the value for each row. The problem has nothing to do with the event. You have a datarowview in the value, you cannot magically turn it into an int, you need to either get it out as a datarowview ( which is what it is ) and then work out where your number is or, preferably, you need to fix the code that sets the datasource, so that it does in fact contain an int as you were hoping. In general, these 'please help me, something blows up' posts are useless, look how long it took us to get to the heart of the problem. You should learn to use your debugger. You'll get your answer a lot quicker if you post something like 'this line throws an invalid cast exception and the value in the row that I'm trying to cast is a datarowview.' A few seconds in the debugger will tell you that, and as you learn C#, that's the path you'd follow to fix the problem, by first knowing what it is. Christian Graus - Microsoft MVP - C++