This is topic Weird bug in forum Math-a-holics and Code Junkies at The Geek Culture Forums.


To visit this topic, use this URL:
http://www.geekculture.com/cgi-bin/ultimatebb/ultimatebb.cgi?ubb=get_topic;f=17;t=000244

Posted by Stereo (Member # 748) on February 17, 2014, 11:30:
 
Hello everyone! Long time since I logged in the forum... But I am very much stumped, and I am not sure the best place to ask, so I thought if my fellow geeks don't know the answer, at least, they'd know where best to ask.

General setting: VB.Net, I have a first combo box which value is used to filter another combo box, both using DataViews filled by a database.

The bug: with production data, the display data doesn't match the value member.

Let's say that the values of the second combo box once filtered, are something like [primary key, foreign key (filtered by the first combo box), "Display data"] {[122, 1, "one value"], [267, 1 "another value"], [520, 1, "a third value"], [etc]}, ordered by the display member.

The Combo box may look like:

(122) a third value
(520) another value
(267) one value

Now, if the data was set to show a previously saved value, say [520, 1, "a third value"], it would lead to having "(520) another value" to be selected. So it shows up wrong to the user, while the value member selected is correct. (I know cause I set a tool tip to show both values, since I couldn't put both in the display part.)

Would anyone have any idea how this could even be possible? For me, it looks like we hit some very weird bug in the Combo Box *or* DataView controls...

Thanks for any input or suggestions!
 
Posted by Stereo (Member # 748) on February 17, 2014, 16:38:
 
Bug found, if anyone is interested. Apparently, when a combobox with a dataview has its "sorted" parameter set to "true", it will only sort the display data, and leave the values unsorted. (Although it looks like this is not always triggered, I would think the length of the list to be a factor.)
 
Posted by TheMoMan (Member # 1659) on February 17, 2014, 22:33:
 
Stereo, good to see you back.
 
Posted by Stereo (Member # 748) on February 18, 2014, 09:50:
 
Thanks, MoMan; I am not sure how "back" I am; With SecondLife and Steampunk interests taking up, I just can't keep up with everything… But I'll try to stop by once in a while! :-)
 
Posted by TheMoMan (Member # 1659) on February 18, 2014, 12:09:
 
Stereo, I too am getting busy, we are trying to set up a complete APRS packet network to use during SkyWarn. Being off of the beaten path and operators so few and far between, I seem to be doing most of the research.

I have most of the cabling done for my mobile set up and am picking up an extra RX/TX for a base station.
 
Posted by Ugh, MightyClub (Member # 3112) on February 18, 2014, 14:51:
 
I haven't done any VB work in a while, and never actually dealt with DataViews, so I'm not going to be much help. But I can offer some random high-level thoughts.

Is your test data identical to the production data? If not, then there may be a flaw in the logic that is not exposed by your test data. For example, maybe primary and foreign keys in the test data line up in some way that is not realistic, which just makes you think the code is working.

Does the first combo box have anything to do with the problem? Have you tried *not* filtering the second combo box to see how it behaves on production data in that case?

By the way is the problem with the second combo box that the displayed description for an item doesn't match the primary key? If so, is that always the case, or only when a selection was previously saved?

Have you tried connecting the DataView to a different control type to eliminate the ComboBox control as the culprit? Ideally you might want to write a bit of code to iterate over the DataView and manually write the contents to the screen or a log file as text so you can be sure what is being passed to the control.
 


© 2015 Geek Culture

Powered by Infopop Corporation
UBB.classicTM 6.4.0