DevExpress CustomRowFilter - 如何触发?

时间:2016-04-27 15:24:19

标签: c# winforms devexpress

我对C#编程非常陌生,所以我希望这是一件我能忽视的简单。

我的表单上有一个XtraGrid.GridControl,我想对其应用CustomRowFilter。

我没有明确定义网格的任何视图,所以我想我将我的CustomRowFilter方法添加到我的GridControl上的MainView的事件处理程序中 - 但是我无法找到如何访问事件我之后?

这是正确的做法还是以错误的方式进行?

    private void gridControl1_CustomRowFilter(object sender, RowFilterEventArgs e)
    {
        GridView view = sender as GridView;
        DataView dv = view.DataSource as DataView;

        if (1==1) //Temp - this should hide everything
        {
            e.Visible = false;
            e.Handled = true;
        }
    }

private void Form1_Load(object sender, EventArgs e)
    {
        //Bind the datasource etc...

        gridControl1.MainView.CustomRowFilter += gridControl1_CustomRowFilter //"Base view does not contain a definition for "CustomRowFilter"
    }

1 个答案:

答案 0 :(得分:4)

Int事件属于sumToN :: Num n => (Int -> n) -> Int -> n sumToN f x n | n<1 = 0 | otherwise = f x n + f x (n-1) facOfN :: Num n => Int -> n facOfN = product [1 .. fromIntegral n] sineApprox :: Fractional n => n -> Int -> n sineApprox x n = (-1)^n * x^(2*n+1) / facOfN (2*n+1) sine sine x = sumToN . sineApprox x 而不属于CustomRowFilter,您可以通过以下方式访问该事件:

GridView