コード例 #1
0
        private void ApplyExternalSortAndFilter()
        {
            Dictionary <ITemplateDefinition, ISortersAndFilters> sortersAndFilterers = new Dictionary <ITemplateDefinition, ISortersAndFilters>();

            foreach (TemplateViewModel template in TemplateViewModels)
            {
                ISortersAndFilters sorterAndFilterer = template.GetSorterAndFilterer();
                if (sorterAndFilterer != null)
                {
                    sortersAndFilterers[template.TemplateDefinition] = sorterAndFilterer;
                }
            }
            if (sortersAndFilterers.Count > 0)
            {
                rootTemplateView.ExternalSortersAndFilters = sortersAndFilterers;
            }
            else
            {
                rootTemplateView.ExternalSortersAndFilters = null;
            }

            rootTemplateView.SetDataSource(rootTemplateView.GetDataSource());
            ETKExcel.TemplateManager.Render(rootTemplateView as IExcelTemplateView);
            //@à((RootTemplateView) rootTemplateView).RenderView();
            //MetroFormWpfContainer.CloseWindowCommandRouted.Execute(null, null);
        }
コード例 #2
0
        protected override void ExecuteFilter(ITemplateView view)
        {
            object dataSource = view.GetDataSource();

            ETKExcel.TemplateManager.ClearView(view as ExcelTemplateView);
            // We reinject the datasource to force the filtering
            ((TemplateView)view).CreateBindingContext(dataSource);
            // RenderView the view to see the filering application
            ETKExcel.TemplateManager.Render(view as ExcelTemplateView);
        }