This is a migrated thread and some comments may be shown as answers.

Does Enabled = False cause Children.Enabled = False?

4 Answers 40 Views
SplitContainer
This is a migrated thread and some comments may be shown as answers.
Ioannis
Top achievements
Rank 2
Ioannis asked on 10 Feb 2019, 12:03 PM

Hello,

So, I have a SplitContainer which contains checkboxes and stuff whose Enabled and Checked statuses will determine what Values will be written on the Database.
When the process to write to the DB begins, I make the Splitcontainer.Enabled = False so that the user will not change anything after the Submit button has already been pressed.
I notice that even though the togglebutton's enabled status is True, when its parent, the Splitcontainer has Enabled=False, the togglebutton itself goes to Enabled=False.
I didn't programme such behaviour, so am I right to assume that this is something that happens by default on Telerik controls?

 

If so, is there a way to globally disable it? On the normal Windows Forms Controls this doesn't exist and I am used to leveraging this behaviour.

4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 11 Feb 2019, 02:30 PM
Hi Ioannis,

This functionality is inherited from the standard .NET controls and I believe that it should work this way. I am not sure how this prevents you from executing your code. You can get the value even if the control is disabled. If you can provide a more detailed description perhaps I can suggest another solution.

I am looking forward to your reply.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Ioannis
Top achievements
Rank 2
answered on 11 Feb 2019, 03:20 PM
You can get the value, but the value will always be FALSE even if when it's actually TRUE.
Unfortunately I can't make a reproducible example at the moment but I'll give an example for the time being and on the evening or tomorrow I can give a reprex.

I have a SplitContainer named SC1 and a togglebutton named tgl1
If I do:
tgl1.Enabled = TRUE
SC1.Enabled = FALSE
then tgl1.Enabled will be FALSE even though it was set to TRUE before.

However, upon doing SC1.Enabled = TRUE, magically tgl1.Enabled is TRUE again.

Is this behaviour expected?
Or is it something that only I am experiencing? (Is so... perhaps I've been changing the tgl1.Enabled value to false without realising it?)
0
Accepted
Dimitar
Telerik team
answered on 12 Feb 2019, 02:17 PM
Hello Ioannis,

Setting the Enabled property of the split container will disable the controls inside it, the Enabled property of the child controls will return the current state but it would not affect the locally set value. In other words, the previous local value will be restored. I have attached a small video that illustrates this.

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Ioannis
Top achievements
Rank 2
answered on 12 Feb 2019, 02:33 PM
I see, thank you :)
Tags
SplitContainer
Asked by
Ioannis
Top achievements
Rank 2
Answers by
Dimitar
Telerik team
Ioannis
Top achievements
Rank 2
Share this question
or