代码
using System;
using System.Collections.Generic;
using System.Text;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.SystemModule;
using DevExpress.ExpressApp.Actions;

namespace Solution1.Module {
    
public class FilterControllerExtender : Controller {
        
protected override void OnFrameAssigned() {
            
base.OnFrameAssigned();
            Frame.GetController
<FilterController>().FullTextFilterAction.Executed += new EventHandler<DevExpress.ExpressApp.Actions.ActionBaseEventArgs>(FullTextFilterAction_Executed);
            Frame.GetController
<FilterController>().Activated += new EventHandler(FilterControllerExtender_Activated);
        }

        
void FilterControllerExtender_Activated(object sender, EventArgs e) {
            
string currentValue = Frame.GetController<FilterController>().FullTextFilterAction.Value as string;
            Frame.GetController
<FilterController>().FullTextFilterAction.DoExecute(
                Frame.View.Info.GetAttributeValue(
"FilterByText_CurrentFilter", currentValue));
        }

        
void FullTextFilterAction_Executed(object sender, DevExpress.ExpressApp.Actions.ActionBaseEventArgs e) {
            
string currentValue = ((ParametrizedAction)e.Action).Value as string;
            
if(Frame.View != null) {
                Frame.View.Info.SetAttribute(
"FilterByText_CurrentFilter", currentValue);
            }
        }
    }
}

 

相关文章:

  • 2021-07-04
  • 2021-08-12
  • 2021-11-11
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2021-05-20
  • 2022-02-27
相关资源
相似解决方案