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

Problem with Padding Property

1 Answer 143 Views
Dock
This is a migrated thread and some comments may be shown as answers.
ztn
Top achievements
Rank 1
ztn asked on 02 Oct 2014, 02:26 PM
Greetings.

I changed the Padding property to All 0 in design mode, the code:

this.radDock1.Padding = new System.Windows.Forms.Padding(0);

was in the designer file, but at runtime the dock still has Padding 4.

I put the code after the InitializeComponent function and did not work.

finally i put the code in the Load event of the form and take effect in runtime.

I am using the last release of rad Controls with framework 3.5.

Regards.

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 07 Oct 2014, 09:44 AM
Hello Jean,

Thank you for writing.

You observe this behavior since the theme sets the padding to the RootElement of RadDock after the InitializeComponent call. You can cancel the setting of this value:
this.radDock1.RootElement.RadPropertyChanging += RootElement_RadPropertyChanging;
.....
void RootElement_RadPropertyChanging(object sender, Telerik.WinControls.RadPropertyChangingEventArgs args)
{
    var valueSource = ((RootRadElement)sender).GetValueSource(args.Property);
    if (args.Property == RootRadElement.PaddingProperty && valueSource == ValueSource.Style)
    {
        args.Cancel = true;
    }
}

You can also set the value after the theme has set it - in the Load event.

Let me know, should you have further questions.

Regards,
George
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Dock
Asked by
ztn
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or