Exemplo n.º 1
0
 public GridViewPresenter(IGridViewFiltro gridView)
 {
     GridView                    = gridView;
     GridView.Inicializa         = OnInicializaGrid;
     GridView.GetValue           = OnGetValueGrid;
     GridView.OrderAction        = OnOrderAction;
     GridView.FiltrarAcion       = OnFiltrarAction;
     GridView.AtivarFiltroAction = OnAtivarAction;
     GridView.ErroPagincaoAction = OnErroPaginacaoAction;
     GridView.AlterarAction      = OnAlterar;
     GridView.FormataCelulaFunc  = OnFormataCelulaAction;
 }
Exemplo n.º 2
0
        public void AdicionaGrid(IGridViewFiltro gridViewFiltro)
        {
            var control = (Control)gridViewFiltro;

            if (metroPanelGrid.Controls.Contains(control))
            {
                return;
            }

            control.Dock = DockStyle.Fill;
            metroPanelGrid.Controls.Add(control);
            metroPanelGrid.Focus();

            _ativarFiltroHandler += (s, e) =>
            {
                gridViewFiltro.AtivarFiltroAction?.Invoke();
            };

            metroButtonFiltrar.Click += _ativarFiltroHandler;
        }