private void TestSequenceButton_Click(object sender, RoutedEventArgs e) { DataAccessMgr daMgr = new DataAccessMgr(ConfigurationManager.AppSettings["ConnectionKey"]); B1SampleEntities entities = new B1SampleEntities(); var query = from a in entities.TestSequences orderby new { a.AppSequenceName, a.AppSequenceId } select new { a.AppSequenceId, a.AppSequenceName, a.DbSequenceId }; MainGridControl.PagingMgr = new PagingMgr(daMgr, query, DataAccess.Constants.PageSize, 10); MainGridControl.SetPage(PagingMgr.PagingDbCmdEnum.First); }
/// <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; } }
private void toolTip_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e) { if (e.SelectedControl == MainGridControl) { ToolTipControlInfo info = null; //Get the view at the current mouse position GridView view = MainGridControl.GetViewAt(e.ControlMousePosition) as GridView; if (view == null) { return; } //Get the view's element information that resides at the current position GridHitInfo hi = view.CalcHitInfo(e.ControlMousePosition); //Display a hint for row indicator cells if (hi.HitTest == GridHitTest.RowIndicator || hi.HitTest == GridHitTest.RowCell && hi.Column.FieldName == "CondenserState") { //An object that uniquely identifies a row indicator cell object o = hi.HitTest.ToString() + hi.RowHandle.ToString(); string text = ""; DataRow row = MainGridView.GetDataRow(hi.RowHandle); if (Convert.ToInt64(row["CondenserState"]) == 0) { text = "Работоспособен"; } else { text = "Неработоспособен"; } info = new ToolTipControlInfo(o, text); } //Supply tooltip information if applicable, otherwise preserve default tooltip (if any) if (info != null) { e.Info = info; } } }