Column Context Header

Posted by: philippe.berhin on 19 May 2021, 9:33 pm EST

  • Posted 19 May 2021, 9:33 pm EST - Updated 3 October 2022, 1:48 pm EST

    hi

    Column context menu has been added recently. Nice feature to have but doesn’t work nicely if you have headers with more than one row. This is something I use very frequently as you can’t always put all info in one cell

    In this case, when you click on the first column you have part of the column header name (see screen shot)

    Also what if you the column 0 is not visible (due to space limitation) You can’t undo your selection.

    All fixed header rows need to be visible

    Thanks

  • Posted 20 May 2021, 11:04 pm EST

    Hi,

    We have escalated the issue to the development team and will let you know when we have an update.

    [Internal tracking ID: C1WIN-24930]

    You can set the MinWidth of the Column-0 using the MinWidth property of the Column so that it stays visible.

    Regards.

    Avnish

  • Posted 21 May 2021, 12:19 am EST

    Hi Avnish

    Thanks for the tip for the Column O

    It would be great to get this solved in the next update

    Thanks

    Philippe

  • Posted 23 May 2021, 11:23 pm EST

    Hi Phillipe,

    The development team will do their best to take action on this issue as soon as they can and we will let you know as soon as there is any update regarding this.

    Best Regards.

    Avnish

  • Posted 5 August 2021, 8:16 pm EST

    I was expecting to get this issue solved in 2021v2 but it is not.

    Any idea if this will be solved one day ?

    thanks

  • Posted 5 August 2021, 8:19 pm EST

    Hi,

    The issue is in the plans, and according to the development team, the tentative ETA for the fix is 21v3.

    Regards

    Avnish

  • Posted 2 December 2021, 9:06 am EST - Updated 3 October 2022, 1:49 pm EST

    I just installed the 2021v3.

    The fix was first expected to be included in v2 and postponed to v3

    But apparently still not. so I imagine it will for 202x Vy

  • Posted 2 December 2021, 2:37 pm EST

    Hi,

    The development team fixed the issue where if you hide one of the columns from the merged column, you can’t hide another column of the same merged column.

    We are getting in touch with them to get information on the multiple entries for the merged header issue. We will let you know as soon as we have an update.

    In the meantime, you can use the ColumnContextMenuOpening event and then change the items of the context menu according to your requirements. Please refer to the sample attached that shows only one entry for merged columns.

    FlexGridContext_mod.zip

    Regards

    Avnish

  • Posted 3 December 2021, 2:24 am EST

    Hi Avnish

    Thanks for the update.

    I was on holiday today, so I will try the ColumnContextMenuOpening event by next week.

    Thanks for the suggestion

    Philippe

  • Posted 12 December 2021, 7:53 pm EST

    The sample doesn’t exactly do what i want. I modified it as follow

    even to add

    c1Flex.ColumnContextMenuOpening += Flex_ColumnContextMenuOpening;

    private void Flex_ColumnContextMenuOpening(object sender, ColumnContextMenuOpeningEventArgs e)

    {

    // cheked if the top-left header cell was clicked

    var flex = (C1FlexGrid)sender;

    if (e.Col == 0 && flex.Rows.Fixed >= 1 && flex.Cols.Fixed >= 1)

    {

    e.ContextMenuStrip.Items.Clear();

    for (int i = 1; i < flex.Cols.Count; i++)

    {

    var item = new ToolStripMenuItem();

    item.CheckOnClick = true;

    item.Checked = flex.Cols[i].Visible;

    item.Tag = i;

    item.Click += Flex_ContextMenu_Click;

    for (int r = 0; r < flex.Rows.Fixed; r++) if (!item.Text.Contains(flex.Rows[r][i].ToString())) item.Text = item.Text += @" " + flex.Rows[r][i];

    e.ContextMenuStrip.Items.Add(item);

    }

    }

    }

        private void Flex_ContextMenu_Click(object sender, EventArgs e)
        {
            ContextMenuChanged(c1Flex,sender);
        }
        
        private new void ContextMenuChanged(C1FlexGrid flex, object menuItem)
        {
            if (menuItem is ToolStripMenuItem { Tag: { } } btn)
            {
                flex.Cols[(int)btn.Tag].Visible = btn.Checked;
            }
        }
    
  • Posted 13 December 2021, 10:36 pm EST

    Hi,

    Good to hear that you were able to do what you want with some modifications.

    If you have any issues, do let us know.

    Regards

    Avnish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels