Hi
I'm making a short application to study wpf and linq to sql. I put a combobox, a text box and a button. When I click on the button, the text I've inserted on the text box has put on the dbo.table. The combobox should show the records of the dbo.table, but I see the new records only when I close and reopen the application.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Data.Linq;
using System.Data.Linq.SqlClient;
namespace WpfApplication1
{
/// <summary>
/// Logica di interazione per Window1.xaml
/// </summary>
public partial class Window1 : Window
{
private DataClasses1DataContext connection = null;
I didn't get into your code deeply but I think the concept shuold be changed.
When you bound the ComboBox to some object you should consider to bound it to object that implement INotifyCollectionChanged (ObservableCollection object for example). Use such object guarantee that when you add or delete an item to the collection, the ComboBox will be refreshed automatic.
If you still have problems (or you want to see an example) upload your project and I will try to help you
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.