Пример #1
0
        public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService svc = null;

            if (provider != null)
            {
                svc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            }

            if (svc != null)
            {
                if (context.Instance is ABCGridBandedControl)
                {
                    ABCGridBandedControl grid = ((ABCGridBandedControl)context.Instance);
                    using (GridBandedColumnConfigForm form = new GridBandedColumnConfigForm(grid.BandedView.ColumnConfigs, grid.BandedView.BandConfigs))
                    {
                        form.TableName = grid.TableName;
                        form.Script    = grid.Script;
                        if (svc.ShowDialog(form) == DialogResult.OK)
                        {
                            grid.BandedView.ColumnConfigs = form.ColumnList;
                            grid.BandedView.BandConfigs   = form.BandsList;
                            grid.BandedView.LoadBands();
                        }
                    }
                }
            }

            return(value);
        }
Пример #2
0
 void ABCCheckEdit_CheckStateChanged(object sender, EventArgs e)
 {
     if (OwnerView != null && OwnerView.Mode != ViewMode.Design && String.IsNullOrWhiteSpace(GridControl) == false)
     {
         Control[] controls = OwnerView.Controls.Find(GridControl, true);
         if (controls.Length > 0)
         {
             if (controls[0] is ABCGridControl)
             {
                 ABCGridControl grid = controls[0] as ABCGridControl;
                 if (grid.GridDefaultView.Columns[ABCCommon.ABCConstString.colSelected] != null)
                 {
                     if (grid.GridDataSource is System.Windows.Forms.BindingSource && (grid.GridDataSource as System.Windows.Forms.BindingSource).DataSource is System.Collections.IList)
                     {
                         foreach (BusinessObject obj in ((grid.GridDataSource as System.Windows.Forms.BindingSource).DataSource as System.Collections.IList))
                         {
                             ABCDynamicInvoker.SetValue(obj, ABCCommon.ABCConstString.colSelected, this.CheckState == System.Windows.Forms.CheckState.Checked);
                         }
                     }
                 }
             }
             if (controls[0] is ABCGridBandedControl)
             {
                 ABCGridBandedControl grid = controls[0] as ABCGridBandedControl;
                 if (grid.BandedView.Columns[ABCCommon.ABCConstString.colSelected] != null)
                 {
                     if (grid.GridDataSource is System.Windows.Forms.BindingSource && (grid.GridDataSource as System.Windows.Forms.BindingSource).DataSource is System.Collections.IList)
                     {
                         foreach (BusinessObject obj in ((grid.GridDataSource as System.Windows.Forms.BindingSource).DataSource as System.Collections.IList))
                         {
                             ABCDynamicInvoker.SetValue(obj, ABCCommon.ABCConstString.colSelected, this.CheckState == System.Windows.Forms.CheckState.Checked);
                         }
                     }
                 }
             }
         }
     }
 }