how to show the c1flexgrid column as button

Posted by: mkoteswararao13 on 10 September 2017, 3:36 am EST

  • Posted 10 September 2017, 3:36 am EST

    hi i am replacing the vs flex grid with c1flex grid i face lot of issues in one of the existing property for vs flexgrid that is

    DBG[b]rid.Columns("DebitAccount").Button = True[/b]

    i need to achieve the same functionality in c1flex grid

    can you please support to solve this error

    Thanks & Regards,
    M.Koteswararao
  • Replied 10 September 2017, 3:36 am EST

    HI,

    You may use the code below using the HostedControl class to implement the same


    For Each r As Row In C1FlexGrid1.Rows
    If r.Index > 0 Then
    'Set row number
    r(0) = r.Index
    'Create Button
    Dim bt As New Button
    bt.BackColor = SystemColors.Control
    bt.Text = "Find"
    bt.Tag = r.Index 'Tag it so the button knows which row it's on
    AddHandler bt.Click, AddressOf Button_Click
    buttonList.Add(New HostedControl(C1FlexGrid1, bt, r.Index, 3))
    End If
    Next


    Refer to the attached sample
    2013/05/FlexGridButtons.zip
  • Replied 4 January 2021, 5:22 am EST

    Hello from Argentina.
    I have a question in regard to this post. What version of Active Reports do I have to be using for seeing the HostedControl class? I am using 2.6.20113..652 C1.Win.C1FlexGrid.2 and I can not find the class named HostedControl.

    In case the class is not present in my version of the product, do I have another way to put a button in a column in my datagrid?



    Thanks in advance.
    Regards.
    Ariel.
  • Marked as Answer

    Replied 4 January 2021, 5:20 pm EST

    Hi,

    Please note FlexGrid is part of ComponentOne(C1) and not ActiveReports.

    There are two ways you can show cell buttons in FlexGrid:

    1.)You can show column buttons in FlexGrid by setting its ComboList property to “…”. For more info visit: Cell Buttons | FlexGrid for WinForms | ComponentOne (grapecity.com).
    https://www.grapecity.com/componentone/docs/win/online-flexgrid/cellbuttons.html

    2.)The in-built cell buttons are shown on the right side of the cell and do not cover the whole cell. The HostedControl class is a custom class created to host controls in the cell. It is not part of any of our APIs. You can refer to the sample located here “C:\Users\UserName\Documents\ComponentOne Samples\WinForms\v4.5.2\FlexGrid\CS\HostControls” and the sample attached above to use HostedControl class to show CellButtons.

    If you have any more questions, please let me know.

    Note: The version 2.6.20113..652 that you are using is too old and we do not support to this much older version so I request you to upgrade to the latest version.

    Regards,
    Prabhat Sharma.
Need extra support?

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

Learn More

Forum Channels