Linked checkboxes in form
Linked checkboxes in form
Hi all,
In one of my reports I have a form with multiple checkboxes.
Is there an easy way (in the events maybe?) to automatically uncheck a checkbox when user selects another?
Can you please provide me with a example of code to include in an event?
(I'm using the user interface, I'm not coding)
Thank you!
In one of my reports I have a form with multiple checkboxes.
Is there an easy way (in the events maybe?) to automatically uncheck a checkbox when user selects another?
Can you please provide me with a example of code to include in an event?
(I'm using the user interface, I'm not coding)
Thank you!
Re: Linked checkboxes in form
Hello,
You can use the following code:
Thank you.
You can use the following code:
Code: Select all
foreach (StiComponent comp in Form1.Components)
{
if (comp is StiCheckBoxControl)
((StiCheckBoxControl)comp).Checked = true;
}
Re: Linked checkboxes in form
Thanks for your quick reply.
Where should I insert this code? Sorry I'm not very used to use code.
I tried this (in the Code tab) but got errors ("Type or name space name StiCheckBoxControl cannot be found"):
Where should I insert this code? Sorry I'm not very used to use code.
I tried this (in the Code tab) but got errors ("Type or name space name StiCheckBoxControl cannot be found"):
Code: Select all
using System;
...
namespace Reports
{public class Report : Stimulsoft.Report.StiReport
{public Report()
{
this.InitializeComponent();
this.PrinterSettings.PrinterName="...";
foreach (StiComponent comp in Form1.Components)
{
if (comp is StiCheckBoxControl)
((StiCheckBoxControl)comp).Checked = true;
}
Re: Linked checkboxes in form
Hello.
They have such behaviour by default.
Thank you.
It seems that it's better to use RadioButtonControls instead of the CheckBoxControls.Jennypi wrote:In one of my reports I have a form with multiple checkboxes.
Is there an easy way (in the events maybe?) to automatically uncheck a checkbox when user selects another?
Can you please provide me with a example of code to include in an event?
(I'm using the user interface, I'm not coding)
They have such behaviour by default.
Thank you.
Re: Linked checkboxes in form
In that case, RadioButtonControls will indeed better fit my need.
Thanks a lot!
Thanks a lot!
Re: Linked checkboxes in form
Hello.
We are always glad to help you.
Let us know if you need any additional help.
Thank you.
We are always glad to help you.
Let us know if you need any additional help.
Thank you.