Example #1
0
        public void ResetLayout(DevExpress.XtraGrid.Views.Grid.GridView view, string gridName)
        {
            RegUtils.DeleteSetting("GridLayout\\" + gridName);
            view.ClearColumnsFilter();
            view.ClearGrouping();
            view.ClearSorting();

            if (view.GetType() == typeof(DevExpress.XtraGrid.Views.BandedGrid.BandedGridView))
            {
                var bandedView = (DevExpress.XtraGrid.Views.BandedGrid.BandedGridView) view;
                foreach (DevExpress.XtraGrid.Views.BandedGrid.GridBand band in bandedView.Bands)
                    band.Visible=true;
            }
        }
Example #2
0
 public void LoadLayout(DevExpress.XtraGrid.Views.Grid.GridView view, string gridName, bool clearSortFilterGrouping = false)
 {
     if (!this.DesignMode)
     {
         var regPath = RegUtils.RegBasePath("GridLayout\\" + gridName);
         if (RegUtils.PathExists(regPath))
         {
             view.RestoreLayoutFromRegistry(regPath.ToString());
             if (clearSortFilterGrouping)
             {
                 view.ClearColumnsFilter();
                 view.ClearGrouping();
                 view.ClearSorting();
             }
         }
     }
 }