Ejemplo n.º 1
0
        protected void initialize(DevExpress.XtraGrid.GridControl grid, IGridButtonAction buttonAction, string[] fieldName, string[] sourceFieldName, bool isValidationEnabled)
        {
            this.ManagedGrid     = grid;
            this.ButtonAction    = buttonAction;
            this.FieldName       = fieldName;
            this.SourceFieldName = sourceFieldName;
            //
            this.ButtonAction.ParentManager = this;


            //
            //if (FieldName.Length != SourceFieldName.Length)
            //{
            //    throw new Exception("Dizi boyutları farklı!");
            //}
            if (FieldName.Length > SourceFieldName.Length)
            {
                throw new Exception("İstenen bilgi boyutu, kaynak boyutundan büyük olamaz!");
            }

            foreach (string name in FieldName)
            {
                if (GetGridview().Columns.ColumnByFieldName(name) != null && GetGridview().Columns.ColumnByFieldName(name).ColumnEdit != null)
                {
                    object nesne = this.GetGridview().Columns.ColumnByFieldName(name).ColumnEdit;
                    DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit button = (nesne as DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit);
                    if (button != null)
                    {
                        button.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(ManagedGrid_ClickCellButton);
                    }
                }
            }


            //GetGridview().RowCellClick += new RowCellClickEventHandler(ManagedGrid_ClickCellButton);

            //this.ManagedGrid.ClickCellButton += new Infragistics.Win.UltraWinGrid.CellEventHandler(this.ManagedGrid_ClickCellButton);
            //this.ManagedGrid.BeforeCellUpdate += new Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventHandler(ManagedGrid_BeforeCellUpdate);
            if (isValidationEnabled)
            {
                //this.ManagedGrid.BeforeCellDeactivate += new System.ComponentModel.CancelEventHandler(ManagedGrid_BeforeCellDeactivate);
                //GetGridview().AfterCellUpdate += new Infragistics.Win.UltraWinGrid.CellEventHandler(this.ManagedGrid_AfterCellUpdate);
            }
            this.ManagedGrid.KeyUp += new System.Windows.Forms.KeyEventHandler(ManagedGrid_KeyUp);
            //ManagedGrid.UpdateMode = Infragistics.Win.UltraWinGrid.UpdateMode.OnCellChange;

            //GetGridview().BeforeCellUpdate
            //this.ManagedGrid.BeforeCellUpdate += new Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventHandler(ManagedGrid_BeforeCellUpdate);
            //if (isValidationEnabled)
            //{
            //    this.ManagedGrid.BeforeCellDeactivate += new System.ComponentModel.CancelEventHandler(ManagedGrid_BeforeCellDeactivate);
            //    this.ManagedGrid.AfterCellUpdate += new Infragistics.Win.UltraWinGrid.CellEventHandler(this.ManagedGrid_AfterCellUpdate);
            //}
            //this.ManagedGrid.KeyUp += new System.Windows.Forms.KeyEventHandler(ManagedGrid_KeyUp);
            //ManagedGrid.UpdateMode = Infragistics.Win.UltraWinGrid.UpdateMode.OnCellChange;
        }
Ejemplo n.º 2
0
 public GridEditButtonManager(DevExpress.XtraGrid.GridControl grid, IGridButtonAction buttonAction, string[] fieldName, string[] sourceFieldName, bool isValidationEnabled)
 {
     initialize(grid, buttonAction, fieldName, sourceFieldName, isValidationEnabled);
 }
Ejemplo n.º 3
0
 public GridEditButtonManager(DevExpress.XtraGrid.GridControl grid, IGridButtonAction buttonAction, string[] fieldName, string[] sourceFieldName)
 {
     initialize(grid, buttonAction, fieldName, sourceFieldName, false);
 }
Ejemplo n.º 4
0
        protected void initialize(DevExpress.XtraGrid.GridControl grid, IGridButtonAction buttonAction, string[] fieldName, string[] sourceFieldName, bool isValidationEnabled)
        {
            this.ManagedGrid = grid;
            this.ButtonAction = buttonAction;
            this.FieldName = fieldName;
            this.SourceFieldName = sourceFieldName;
            //
            this.ButtonAction.ParentManager = this;

            //
            //if (FieldName.Length != SourceFieldName.Length)
            //{
            //    throw new Exception("Dizi boyutları farklı!");
            //}
            if (FieldName.Length > SourceFieldName.Length)
            {
                throw new Exception("İstenen bilgi boyutu, kaynak boyutundan büyük olamaz!");
            }

            foreach (string name in FieldName)
            {
                if (GetGridview().Columns.ColumnByFieldName(name) != null && GetGridview().Columns.ColumnByFieldName(name).ColumnEdit!=null)
                {
                    object nesne=this.GetGridview().Columns.ColumnByFieldName(name).ColumnEdit;
                    DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit button = (nesne as DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit);
                    if(button!=null)
                        button.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(ManagedGrid_ClickCellButton);

                }
            }

            //GetGridview().RowCellClick += new RowCellClickEventHandler(ManagedGrid_ClickCellButton);

            //this.ManagedGrid.ClickCellButton += new Infragistics.Win.UltraWinGrid.CellEventHandler(this.ManagedGrid_ClickCellButton);
            //this.ManagedGrid.BeforeCellUpdate += new Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventHandler(ManagedGrid_BeforeCellUpdate);
            if (isValidationEnabled)
            {
                //this.ManagedGrid.BeforeCellDeactivate += new System.ComponentModel.CancelEventHandler(ManagedGrid_BeforeCellDeactivate);
                //GetGridview().AfterCellUpdate += new Infragistics.Win.UltraWinGrid.CellEventHandler(this.ManagedGrid_AfterCellUpdate);
            }
            this.ManagedGrid.KeyUp += new System.Windows.Forms.KeyEventHandler(ManagedGrid_KeyUp);
            //ManagedGrid.UpdateMode = Infragistics.Win.UltraWinGrid.UpdateMode.OnCellChange;

            //GetGridview().BeforeCellUpdate
            //this.ManagedGrid.BeforeCellUpdate += new Infragistics.Win.UltraWinGrid.BeforeCellUpdateEventHandler(ManagedGrid_BeforeCellUpdate);
            //if (isValidationEnabled)
            //{
            //    this.ManagedGrid.BeforeCellDeactivate += new System.ComponentModel.CancelEventHandler(ManagedGrid_BeforeCellDeactivate);
            //    this.ManagedGrid.AfterCellUpdate += new Infragistics.Win.UltraWinGrid.CellEventHandler(this.ManagedGrid_AfterCellUpdate);
            //}
            //this.ManagedGrid.KeyUp += new System.Windows.Forms.KeyEventHandler(ManagedGrid_KeyUp);
            //ManagedGrid.UpdateMode = Infragistics.Win.UltraWinGrid.UpdateMode.OnCellChange;
        }
Ejemplo n.º 5
0
 public GridEditButtonManager(DevExpress.XtraGrid.GridControl grid, IGridButtonAction buttonAction, string[] fieldName, string[] sourceFieldName, bool isValidationEnabled)
 {
     initialize(grid, buttonAction, fieldName, sourceFieldName, isValidationEnabled);
 }
Ejemplo n.º 6
0
 public GridEditButtonManager(DevExpress.XtraGrid.GridControl grid, IGridButtonAction buttonAction, string[] fieldName, string[] sourceFieldName)
 {
     initialize(grid, buttonAction, fieldName, sourceFieldName, false);
 }