/// <summary> /// Load data from DB /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void MainForm_Load(object sender, EventArgs e) { try { MainRibbonControl.Enabled = false; DataLoadingProgressPanel.Visible = true; using (PersonsReference.PersonsServiceClient client = new PersonsReference.PersonsServiceClient()) { personBindingSource.DataSource = (await client.GetPersonsDSAsync()).ToList(); MainGridControl.RefreshDataSource(); } MainRibbonControl.Enabled = true; DataLoadingProgressPanel.Visible = false; RefreshDataButtonItem.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; } catch { ShowErrorMessage(Properties.Resources.DataLoadingError); RefreshDataButtonItem.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; MainRibbonControl.Enabled = true; } }