Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How do I refresh the ItemsSource for a ComboBox during runtime after adding a record to my ACCDB dataset?

$
0
0

I have posted multiple questions here as I have struggled through the stages of developing this software.

My application has two windows(using WPF and C# in Visual Studio 2015).

The first window shows:

(1)a button which allows the user to search the detail form records for any substring within any desired field(by entering a partial string into the chosen field to search, then pointing-and-clicking a button to execute the search).  A new window then displays, listing the primary key data value for each record for which the partial value is found in the chosen field.  The user can then point-and-click on the desired primary key value from the list to open its record and show all of its values, making edits, if desired.  After making edits, the user points-and-clicks a save button.).

(2)a ComboBox which displays the primary key values within the dataset, accompanied by a button to open a new window and display a record after the user selects a primary key value from the list.

(3)a button to open the detail form with all fields blank, in order to allocate a new record.  After data values are added, the user then points-and-clicks a save button.

The only remaining problem is this:

The ComboBox shows all primary key values in existence at the time the program is opened, but I need to refresh the ItemsSource for the ComboBox, so that a primary key value will be added to the ComboBox after each new record is added, as in (3) above.

I do know that the newly-added records are available to the app.  They appear in the search results (1), as appropriate.

The Combobox is the only place that does not update to make them available.

Any help would be much appreciated.  My project as it is now does run, but that last capability is not yet there.

Thank you very much!




Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>