Esempio n. 1
0
        public void RefreshGrid()
        {
            try
            {
                if (localDataContext == null)
                {
                    localDataContext = new LocalDataEntities(Properties.Settings.Default.LocalConnectionString);
                    localDataContext.DetectChanges();
                }
                bindingSource.DataSource = localDataContext.EDMApplications;

                foreach (var fieldName in new string[] {"Id", "UserMenuOptions", "Users"})
                {
                    var col = viewItems.Columns.ColumnByFieldName(fieldName);
                    if (col != null)
                    {
                        col.Visible = false;
                        col.OptionsColumn.ShowInCustomizationForm = false;
                    }
                }
                btnSave.Enabled = false;
                btnDelete.Enabled = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
 public void RefreshGrid()
 {
     try
     {
         if (localDataContext == null)
         {
             localDataContext = new LocalDataEntities(Properties.Settings.Default.LocalConnectionString);
             localDataContext.DetectChanges();
         }
         bindingSource.DataSource = localDataContext.EDMUsers;
         btnSave.Enabled = false;
         btnDelete.Enabled = false;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }