We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Setting Width and Height in runtime

Hi,

I'm trying to set the desiredwidthindockedmode and desiredheightindockedmode of contentcontrol in XAML based on the sideindockedmode property during runtime. I've tried using the triggers to achieve this functionality but it doesnt work. Can you please provide a solution for this?

Regards,
Aishwaria

3 Replies

BA Balavasanth Syncfusion Team May 25, 2009 03:47 PM UTC

Hi Aishwarya,

Thanks for your interests in Syncfusion products.

At the run time we have some issues with the SetDesiredHeightInDockedMode and SetDesiredWidthInDockedMode. To overcome this constraint We have implemented a new methods for setting the hosted element’s Height and Width. You can make use of this. This can be achieved by using the following code snippets.

Dim host As DockedElementTabbedHost = DockingManager.GetHost(elementone, DockState.Dock);
DockingManager.SetHostHeight(host, 500);
DockingManager.SetHostWidth(host, 500);

Please let us know if you have any queries.

Regards,
Bala.


AD Administrator Syncfusion Team May 25, 2009 05:08 PM UTC

Hi,

How can the same code be implemented in XAML?

Regards,
Aishwaria


BA Balavasanth Syncfusion Team May 26, 2009 02:14 PM UTC

Hi Aishwarya,

Thanks for your interests in Syncfusion products.

As we said in my previous update, we have some issues with the DesiredHeightInDockedMode, DesiredWidthInDockedMode properties while we change in run time. You can easily use those properties in the trigger as follows.

[XAML]








But currently due to this defect we will not be able to change the DesiredHeightInDockedMode, DesiredWidthInDockedMode properties dynamically. So you will not be able to use it in the XAML. This will be fixed in our upcoming releases.Asas As work around you can make use of the SetHostHeight and SetHostWidth methods, using which you can dynamically iterate through the each and every element of the Docking Manager check for the corresponding side in Docked Mode for the frame work element and apply the host height and width for the corresponding element.

//iterate through each and every element
foreach (FrameworkElement felement in dockingmanager.Children)
{
//check the SideInDockedMode

if (DockingManager.GetSideInDockedMode(felement) == DockSide.Bottom)
{
DockedElementTabbedHost host = DockingManager.GetHost(elementone, DockState.Dock);
DockingManager.SetHostHeight(host, 500);
DockingManager.SetHostWidth(host, 500);
}
}

Please let us know if you have any queries.

Regards,
Bala.




Loader.
Live Chat Icon For mobile
Up arrow icon