Skip to main content

Change Content Alignment in Run Time

Comments

1 comment

  • Dapfor Team

    Hi,

    1. You can modify header's toolstrip in runtime. Look at the code, provided below:

    grid.HeaderContextMenu.Opening += delegate(object sender, CancelEventArgs e) 
    {
    Column column = grid.HitTests.ColumnTest(grid.PointToClient(Cursor.Position));
    if(column != null)
    {
    ContextMenuStrip menu = sender as ContextMenuStrip;
    if (menu != null)
    {
    menu.Items.Insert(0, new ToolStripMenuItem("Right", null, delegate
    {
    column.Appearance.CellTextAlignment = ContentAlignment.MiddleRight;
    }));
    }
    }
    };

     

    2. The grid doesn't support this feature yet. Our dev team will take care about your demand. If you absolutely need to implement this feature, it can be emulated in the Grid.PaintCell event handler.

    Kind regards,
    The Dapfor Team

    0

Please sign in to leave a comment.

Powered by Zendesk