Create c1checkbox object name dynamicaly

Posted by: mysql.jorge on 21 April 2018, 2:19 pm EST

    • Post Options:
    • Link

    Posted 21 April 2018, 2:19 pm EST

    Howdy,

    I’m trying to achieve something that I don’t know if it’s possible.

    I need to create objects with a custom name based on records, and add them to a flowlayoutpanel, how could I do this?

    2nd question, is there a more enhanced control from C1, for “flowlayoutpanel” ?

    Thanks in advanced,

  • Posted 21 April 2018, 2:21 pm EST

    My code is:

    Dim dt As New DataTable

    sql = “select * from groups where x=‘true’”

    dt = SqlDataTable(sql)

    For i As Int32 = 0 To dt.Rows.Count - 1

    Dim ck As New C1.Win.C1Input.C1CheckBox

    ck.Size = New System.Drawing.Size(123, 50)

    ck.Value = False

    ck.Appearance = Appearance.Button

    ck.BorderStyle = BorderStyle.None

    ck.VisualStyle = Me.VisualStyle

    FlowLayoutPanel1.Controls.Add(ck)

    Next

    dt.Dispose()

    dt = Nothing

  • Posted 24 April 2018, 12:45 am EST

    Hello,

    As per our understanding of the question, you wish to add C1CheckBox to FlowLayoutPanel for different values from a datatable. A sample showing the same, modifying your sample code, has been attached for your reference. The DataTable is created from the records of Products table in C1Nwind.mdb, that’s shipped with the product. Let us know if any issue persists.

    As of now, there is no C1 control corresponding to the functionality of FlowLayoutPanel.

    Best Regards,

    Esha

    prj_C1CheckBox_FlowLayoutPanel.zip

  • Posted 26 April 2018, 7:12 am EST

    Hi,

    Thank you, it’s +/- what I need, i’m missing one thing.

    I want to catch the event of the c1 checkbox’s that are inside the flowlayoutpanel, how could I do this?

    Sorry if it’s a bit offtopic.

  • Posted 26 April 2018, 9:11 am EST

    Oh got it, sorry for the noise:

    AddHandler ck.Click, AddressOf ck_click

Need extra support?

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

Learn More

Forum Channels