Posted 7 July 2020, 6:12 pm EST - Updated 3 October 2022, 11:46 pm EST
Is possible to implement a grid a button in cell like the attached image?
Forums Home / ComponentOne / WinForms Edition
Posted by: psergio.p on 7 July 2020, 6:12 pm EST
Posted 7 July 2020, 6:12 pm EST - Updated 3 October 2022, 11:46 pm EST
Is possible to implement a grid a button in cell like the attached image?
Posted 8 July 2020, 4:49 am EST
Hi,
whow, a WinXP screenshot ;-)…
To add controls to cells, take a look at the “HostControls” sample: https://www.grapecity.com/samples/hostcontrols
You will have to create n buttons for n rows.
Hope this helps
Wolfgang
Posted 8 July 2020, 5:15 am EST
Hello,
Yes, you can create a button in the cell, like in the image shared.
You can add buttons onto the FlexGrid like you would do on a container control and then position and scale the button according to the cell it is supposed to be in. You can store the row and column index of the cell (where a button is located) in the Tag property of the Button. Further, the Click event is subscribed while creating the button. This will help in identifying which button is clicked (using the indexes stored in Tag). I have stored the index in a Point, the X of the Point is row index while Y is the column index.
Please find the attached solution which demos the same.
@Wolfgang, thank you for your help. We have created the sample using the same approach as implemented in the HostControls product sample.
Regards,
Prabhat Sharma.
ButtonColumn (1).zip
Posted 2 November 2023, 10:49 am EST
Thank you!