C# Developers' Journal (original) (raw)

11:40a

Data-bound controls not updating. This is actually a revised versino of my post from Sept. 26th, because upper management went and changed everything on me again... but I'm having the same problem, just with different controls.

I have a form that is, basically, a master-detail form. The master and the detail are stored in separate tables. My goal is to get the following pseudocode to run:

When the master record is changed by changing the value of the combobox containing the NAME field in the databound controls that govern the master record:
1. Filter the binding source for the detail records based on the new value in the ID text box.
2. Sort the binding source according to a field specified in a parameter (so it can be customized by the user).
3. Populate a number of controls with the data in the first record returned in the binding source.

In order to achieve these ends, I have the following coad both in the form load event on the combobox's SelectedItemChanged event:

bsRate.Filter = "prov_id = " + txtProvNo.Text; bsRate.Sort = "mexp desc"; //bsRate.ResetBindings(false);

I'm assuming at this point that step 3 of the pseudocode SHOULD be automatic, as the controls are all databound to the binding source in question.

Now, here's the problem: nothing is returned, as far as I can tell. I've tried traces and watch variables, but every time I pause the debugging to see what the value of each of those variables is, I am told the program is actually sitting at the command that launches the very first form in the program (this form is one more down the chain), so I can never see if the filter and sort are even being applied. I do know that records exist for the first master field to come up, and even if by some odd coincidence they weren't showing up, I've tried switching master records. No matter what, I get no detail at all. Whether the ResetBindings line is commented out or not makes no difference in the least.

I am at a complete loss and frustrated beyond reason. This project is well overdue (not entirely my fault, but we'll not go into that). I'm not even sure what you need to see in order to help, whether my description is clear enough, anything. I am in desperate need of assistance. Anything else you need to know, please tell me, or if you have a suggestion, by all means, toss it out there. I have got to get this done in the next four and a half hours-- this piece of it, at least.

Thank you.

Current Mood: blank