Telerik Tab Control - Only the currently SelectedPage shows controls visibility correctly

StackOverflow https://stackoverflow.com/questions/23265587

  •  08-07-2023
  •  | 
  •  

Question

I'm using the 2013 Q3 Telerik Tab control in a C# WinForms project. If I test the .Visible property of a control placed on a Page in the Tab then it will always return false unless I Select the page. Is there another property besides .Visible that can be used to test the Visibility of a control on a Page without having to select it?

Was it helpful?

Solution

Here's my dilatation: You should not change the native meaning of the control's properties. Period. I asked in a comment what were you trying to achieve, because I suspected that you're basing some UI logic on some control's visibility, which in my opinion isn't too good approach. The visibility should be bound to the background logic, not the oposite. You're hiding controls for some reason, because at some point something happened - so keep track of that "something" instead of inspecting its results. IMO the Visibility property should be set, but never checked.

Alternatively if it's not possible to change the concept for some reason, as a workaround I'd attach a handler to the VisibleChanged event and set Enabled property if the sender is not a tab control - then by checking against Enabled property you'd know whether the control is in use or not. I find it difficult to imagine a situation in which I'd need to check whether a control is visible.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top