Very Basic Data Binding Issue (ListBox updating)
Hello All,
I went through a video tutorial (via http://www.franklins.net/videos.asp) on basic databinding but am not able to get the same results and it's driving me nuts. I've used databinding before but have no clue about this very simple scenario.
Here's the scenario: I created a new vb.net Windows App project in VS.Net 2003 Pro. I then dragged a database table (from Server Explorer) to the form to create a connection and adapter, then generated a dataset (dsEmployees). I then added a ListBox, 2 TextBoxes and a DataGrid to the form. I bound the components to the dataset (listbox & one textbox to emp_lname, other textbox to emp_address or whatever, and datagrid to Employees table).
When I edit the emp_lname field in the datagrid and move off the field (i.e. select another row or field), the ListBox and TextBox correctly display the change. Also, when I make a change to the emp_lname field in the TextBox and then click on the *datagrid*, all 3 components correctly display the change.
Here's the problem: when I edit the emp_lname field via the textbox and click on the ListBox, the datagrid correctly displays the new value (from the just-edited TextBox) but the last name in the ListBox is not updated.
My Question: why is the ListBox correctly updated (after a change has been made to the textbox) *only* when I click on the datagrid and not when I click on the ListBox. In other words, what event is getting triggered when the datagrid is selected and not triggered when the ListBox is selected?
Thanks for your expertise on this very simple problem.
Troy