Search code examples
griddevexpressfootersummary

How to disable the Footer summary for certain columns?


I am using a devexpress grid and i don't want to have any footer or group summary for string columns. The user can modify the formula used for the footer summary by accessing the footer menu. I want this menu to be disabled for string columns, since the provided summaries do not make sense for string columns. Any ideas?


Solution

  • For all those interested in the solution: Handle the ShowGridMenu event of the grid:

    private void MainView_ShowGridMenu(object sender, GridMenuEventArgs e)
    {
        Column col;
        if (e.MenuType == GridMenuType.Summary && e.HitInfo.Column != null && e.HitInfo.Column.ColumnType == typeof(string))
        {
            e.Allow = false
        }
    }