I use Xtragrid. I would like to change the default popupmenu columnmenu GridViewColumnMenu and add ColorPieker and FontEditor to change color of cells in the Column and font of the column. Add to the standard menu column two editors have failed. More precisely, the menu items were added, but by clicking on them, nothing happens. I also tried to add all of the standard menu items to menu with the editors, and display it all in barmanager. In this case, working as editor of color and font selection, but the standard menu(GridViewColumnMenu) items dont work
if (e.MenuType == DevExpress.XtraGrid.Views.Grid.GridMenuType.Column)
{
DevExpress.XtraGrid.Menu.GridViewColumnMenu menu = e.Menu as GridViewColumnMenu;
// menu.Items.Clear();//Erasing the default menu items
if (menu.Column != null)
{
ClickedColumn = "";
ClickedColumn = menu.Column.FieldName;
DXPopupMenu dxPopupMenu = new DXPopupMenu();
dxPopupMenu.Items.Add(new DXEditMenuItem("Color",
new RepositoryItemColorEdit(),
new EventHandler(OnColumnsColorChanged),
null, null, 100, 0));
dxPopupMenu.Items.Add(new DXEditMenuItem("Font",
new RepositoryItemFontEdit(),
new EventHandler(OnColumnsFontChanged),
null, null, 100, 0));
DXPopupMenu sub = new DXPopupMenu();
sub.Caption = "FixedStyle";
sub.Items.Add(CreateCheckItem("Fixed None", menu.Column, FixedStyle.None, null));
sub.Items.Add(CreateCheckItem("Fixed Left", menu.Column, FixedStyle.Left, null));
sub.Items.Add(CreateCheckItem("Fixed Right", menu.Column, FixedStyle.Right, null));
dxPopupMenu.Items.Add(sub);
/*
DXPopupMenu dx = new DXPopupMenu();
dx.Caption = "dx";
foreach (DXMenuItem item in menu.Items)
{
dx.Items.Add(item);
}
//dxPopupMenu.Items.Add(dx);
*/
menu.Items.Clear();
Point p = e.Point;
// p.X += 210;
dxPopupMenu.MenuViewType = MenuViewType.Menu;
((IDXDropDownControl)dxPopupMenu).Show(barManager1, this, p);
Tried to display and menus and menu editors barmanager simultaneously, it all works. But it is not so easy sometimes menus overlap each other.