I've never actually programmed in C#, I received that code from another person, altered it as best I could to VB and ran with it. So I'm not sure I'm quite the person to ask. I will try and answer your questions, but I have also just barely started programming 3 months ago, and I'm still mostly confused by the whole thing. I would recommend creating a new post in the .NET forum. There are a lot of people who program in C# there.
First Question. the infinity error. The listbox that I used this program for was bound to a table. Therefore, most the of the normal ways of looking at my listbox did not work, because instead of my items being just text, they were whole rows in a table. I think your listbox is just text and not bound. As a result, the whole datarowview thing might not work, because your items are not datarowview things, they are just strings. (maybe) Earlier in this Thread we talked about some ways to get values out. Most of the ideas did not work for me, because my listbox was bound. They might work for you, if you can convert them to C#.
Second Question, I think the column and row thing is really just how a person looks at it. the Rows came, because my listbox was bound to a table, and each item in my listbox came from a different row in my table. The column part, was just what SammyB called his variable, I named mine blahblah. However, looking at the values as part of a column makes a lot of sense.
Third Question, my guess is that when you are setting the value member, you are not setting it individually for each listbox item. When I set the value member for my listbox, I set it as a certain column in my table. Therefore the program went through and matched up the the values in two different columns in my program. It made one value, the display member that users could see, and made the other value, the hidden value that only I saw. The point was, I only set my valuemember once for my whole listbox, and it applied to the whole thing. If you want to apply the value to only one item, you are going to need to specify that one item somehow.
These are my best guesses to your questions, but I can't really give you any code to help you follow. Try posting in the .NET forum, they might be able to give you the code you are looking for.
First Question. the infinity error. The listbox that I used this program for was bound to a table. Therefore, most the of the normal ways of looking at my listbox did not work, because instead of my items being just text, they were whole rows in a table. I think your listbox is just text and not bound. As a result, the whole datarowview thing might not work, because your items are not datarowview things, they are just strings. (maybe) Earlier in this Thread we talked about some ways to get values out. Most of the ideas did not work for me, because my listbox was bound. They might work for you, if you can convert them to C#.
Second Question, I think the column and row thing is really just how a person looks at it. the Rows came, because my listbox was bound to a table, and each item in my listbox came from a different row in my table. The column part, was just what SammyB called his variable, I named mine blahblah. However, looking at the values as part of a column makes a lot of sense.
Third Question, my guess is that when you are setting the value member, you are not setting it individually for each listbox item. When I set the value member for my listbox, I set it as a certain column in my table. Therefore the program went through and matched up the the values in two different columns in my program. It made one value, the display member that users could see, and made the other value, the hidden value that only I saw. The point was, I only set my valuemember once for my whole listbox, and it applied to the whole thing. If you want to apply the value to only one item, you are going to need to specify that one item somehow.
These are my best guesses to your questions, but I can't really give you any code to help you follow. Try posting in the .NET forum, they might be able to give you the code you are looking for.
Originally posted by OliveOyl3471
Comment