private void btnRefresh_Click(object sender, EventArgs e) { dbContext = new CTestEntities(); dbContext.ProgramMains.Load(); programMainsBindingSource.DataSource = dbContext.ProgramMains.Local; gridControl1.Refresh(); }
private void frmMain_Load(object sender, EventArgs e) { //string[] ports = SerialPort.GetPortNames(); //cbxPort.Properties.Items.AddRange(ports); //cbxPort.SelectedIndex = 0; dbContext = new CTestEntities(); dbContext.ProgramMains.Load(); programMainsBindingSource.DataSource = dbContext.ProgramMains.Local; gridControl1.Refresh(); }