Esempio n. 1
0
    protected void ASPxGridView1_DataBinding(object sender, EventArgs e)
    {
        GridViewDataColumn newFilterColumn       = null;
        IEnumerable <GridViewDataColumn> columns = GetDataColumns();

        foreach (GridViewDataColumn column in columns)
        {
            if (string.IsNullOrEmpty(Expressions[column]) && !string.IsNullOrEmpty(column.FilterExpression))
            {
                newFilterColumn = column;
                break;
            }
        }
        if (newFilterColumn != null)
        {
            foreach (GridViewDataColumn column in columns)
            {
                if (!Equals(column, newFilterColumn))
                {
                    ASPxGridView1.AutoFilterByColumn(column, null);
                }
            }
        }
    }