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

RadDock is not a ContainerControl

1 Answer 86 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Phillip
Top achievements
Rank 1
Phillip asked on 14 Aug 2009, 11:16 AM
The Q2 2009 RadDock control does not SetStyle(ControlStyles.ContainerControl) and so is not seen in .net as a ContainerControl. This causes problems when calling Form.ValidateChildren or Control.Validate to force validation of controls held in a RadDock window.

My workaround is to explicitly handle the radDock_Validating event in my code like this;

private void radDock_Validating(object sender, CancelEventArgs e)
{   
    if(! ((ContainerControl)this.radDock.ActiveWindow).Validate())
    {
        e.Cancel = true;
    }
}

The .net framework behaves oddly when cascading the Validate event through a control stack, and instead of simply iterating a controls .Controls collection, it explicitly checks to see if a the Control.GetStyle(ControlStyles.ContainerControl) is true before deciding to iteratve the .Controls collection. Because RadDock does not set this property it is in effect telling the .net Framework "I don't have any children, so don't bother looking any further". By manually cascading the Validating event as shown above, we jump this gap.
 
I don't know if this particular pattern is followed in any other cascading functionality in the .net framework.

1 Answer, 1 is accepted

Sort by
0
Accepted
Julian Benkov
Telerik team
answered on 18 Aug 2009, 10:35 AM
Hi Phillip,

Thank you for sharing your code. We will do a research for this kinds of problems and if we have introduced incorrect validation logic will change RadDock to follow the right one. Your Telerik points have been updated.

Sincerely yours,
Julian Benkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Dock
Asked by
Phillip
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Share this question
or