示例#1
0
 void SetControl(DevExpress.XtraGrid.GridControl c)
 {
     c.SuspendLayout();
     c.BeginInit();
     foreach (DevExpress.XtraGrid.Views.Grid.GridView gv in c.Views)
     {
         foreach (DevExpress.XtraGrid.Columns.GridColumn col in gv.Columns)
         {
             col.Caption = rm.GetString(string.Concat(col.Name, ".Caption"), culture);
             col.ToolTip = rm.GetString(string.Concat(col.Name, ".ToolTip"), culture);
         }
     }
     c.EndInit();
     c.ResumeLayout();
 }
        void SetControl(DevExpress.XtraGrid.GridControl gridControl)
        {
            gridControl.SuspendLayout();
            gridControl.BeginInit();
            foreach (DevExpress.XtraGrid.Views.Grid.GridView gridView in gridControl.Views)
            {
                if (ui_captionsList_ContainsKey("GroupPanelText"))
                {
                    var v = ui_captionsList_get("GroupPanelText");
                    gridView.GroupPanelText = v.TextValue;
                }
                foreach (DevExpress.XtraGrid.Columns.GridColumn gridColumn in gridView.Columns)
                {

                    if (gridColumn.Tag != null)
                    {
                        if (!string.IsNullOrEmpty(gridColumn.Tag.ToString().Trim()))
                        {
                            if (ui_captionsList_ContainsKey(gridColumn.Tag.ToString()))
                            {
                                var v = ui_captionsList_get(gridColumn.Tag.ToString());
                                gridColumn.Caption = v.TextValue;

                                gridColumn.ToolTip = v.TooltipValue;
                            }
                        }
                    }
                }
            }
            gridControl.EndInit();
            gridControl.ResumeLayout();
        }
示例#3
0
        /// <summary>
        /// Refreshes and redisplays a grid 
        /// </summary>
        /// <param name="grid"></param>
        /// <param name="view"></param>
        /// <param name="level"></param>
        private void RefreshGrid(DevExpress.XtraGrid.GridControl grid, GridView view, int level)
        {
            var timeStart = System.DateTime.Now;
            this.Cursor = Cursors.WaitCursor;
            base.UpdateStatusMessage("Loading...");

            view.ClearColumnsFilter();
            view.ClearGrouping();
            view.ClearSorting();

            Application.DoEvents();

            try
            {
                grid.Visible = false;
                grid.SuspendLayout();

                view.ClearColumnErrors();
                view.OptionsView.EnableAppearanceEvenRow = false;
                view.OptionsView.EnableAppearanceOddRow = false;
                view.OptionsBehavior.Editable = this.EditMode;

                _highlights.Clear();

                grid.Visible = true;
                // SetupColumns(view, level);
                SetupMenu();
                grid.Views[0].RefreshData();
                grid.ResumeLayout();

            }
            catch (Exception ex)
            {
                ErrorDialog.Show(ex, "RefreshGrid");
            }
            this.Cursor = Cursors.Default;
            UpdateStatusMessage(string.Format("Load time {0:0.0}secs", System.DateTime.Now.Subtract(timeStart).TotalSeconds));
        }