Disable multiline in a C1FlexGrid Cell for winform?

Posted by: mmoukalled on 28 October 2019, 9:32 am EST

    • Post Options:
    • Link

    Posted 28 October 2019, 9:32 am EST

    Is it possible to disable multi-line in a C1FlexGrid Cell for winform when pressing Ctrl+Enter ?

  • Posted 29 October 2019, 6:01 pm EST

    Hi,

    The interpretation of key combination is done by the editor itself, so you would need to modify properties of the editor to disable multi-line.

    For instance, you can use a TextBox as editor for a column, and set its ‘Multiline’ property to false:

    var textBox = new TextBox();
    textBox.Multiline = false;
    c1FlexGrid1.Cols[1].Editor = textBox;
    

    Regards,

    Jitender

  • Posted 4 November 2019, 6:57 am EST

    Hi,

    Thank you for your reply.

    I knew about this approach and was hopping there is a better solution; in my application i have many Flexgird controls with very complex logic to load and manipulate the data, and setting the editor to textbox might requires a lot of changes to the control events.

    Also i do use in some cases the textbox as editor for some cells, but what if found, that dynamically resizing the columns width does not position the overlay-ed text box properly and it shows little shifted in the x axis- i did some workaround this issue though.

    The question is why the control does not have the ‘Multiline’ property?

    thx

    Mahmoud

  • Posted 4 November 2019, 3:08 pm EST

    Hi,

    The textbox should appear correctly, can you please share a small sample that shows how you are doing this so we can look over it?

    The cell editing behavior is controlled by the cell editor. The grid won’t even receive any key or mouse events as long as the editor is active. This is why there is no Multiline property on the grid.

    Regards,

    Jitender

Need extra support?

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

Learn More

Forum Channels