Home » excel » Multiple groups of radio buttons on the same Excel worksheet using Aspose Cells

Multiple groups of radio buttons on the same Excel worksheet using Aspose Cells

Posted by: admin May 14, 2020 Leave a comment

Questions:

Is it possible to add more than one group of radio buttons to a single Excel worksheet using Aspose Cells for .NET?

I’ve tried doing this, but they they all seem to share the same group. Adding the radio buttons inside GroupBoxes doesn’t seem to help. What am I doing wrong?

The sample code on Aspose’s website only adds one set of radio buttons to each worksheet. Is it even possible to add multiple groups? (It works if you set it up manually in Excel.)

How to&Answers:

It took me a while to figure out what the problem was. The radio buttons in a group must be completely inside the group boxes (they can share a border with the box, but must not stray outside). Any radio buttons that are not completely bounded by a group box are assigned to the default group.

By default the radio buttons have no border or background, so it’s not obvious just from looking at the generated Excel worksheet whether or not they are completely inside their grouping box. In my case, the radio buttons were overlapping the border of the grouping box.

Once I reduced the size of the radio buttons so they were contained completely inside the grouping box, it all worked as expected: two independent groups of radio buttons.