drawerContentSize not working

Thread is closed for posting
3 posts, 0 answers
  1. Grégory
    Grégory avatar
    5 posts
    Member since:
    Oct 2015

    Posted 25 Feb 2017 Link to this post



    I'm using a RadSideDrawer with Nativescript Angular (pro version)

    I'm unable to set the drawerContentSize property, it's never change the height (or the width) of the menu panel.


    I have tried to set it programmatically :

    @ViewChild(RadSideDrawerComponent) public drawerComponent: RadSideDrawerComponent;
    ngOnInit() {
         this.drawerComponent.drawerContentSize = 800;


    Or directly inside the view :

    <RadSideDrawer  [drawerLocation]="currentDrawLocation" [drawerContentSize]="500">


    Both are not working.


    Thanks for your help

  2. Nikolay Iliev
    Nikolay Iliev avatar
    351 posts

    Posted 27 Feb 2017 Link to this post

    Hello Gregory,

    The reason for you side drawer content size not to change the code in your code behind is because you are passing too large value. With a relatively common device with e.g. something like 1080 x 1920 (420dpi) then a value of 400 will set approx 80% width (for left/right side drawer)/ The reason is that the value you are setting is device independent pixels.
    @ViewChild(RadSideDrawerComponent) public drawerComponent: RadSideDrawerComponent;
    ngOnInit() {
         this.drawerComponent.drawerContentSize = 400;

    will result in the following drawer(on a Nexus-5 device)

    When setting the value to 200 on the same device, it will produce the following width:

    More about device independent pixels (a.k.a. as dp or dip) and the formula used for their creation can be found here.

    Your HTML related code will also work on the same principle but with one correction.
    <RadSideDrawer drawerContentSize="200" >
    Note that now our property lacks the binding brackets and we are passing the value directly.
    The code above was tested and verified with modifying this example.

    Nikolay Iliev
    Telerik by Progress
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
  3. Grégory
    Grégory avatar
    5 posts
    Member since:
    Oct 2015

    Posted 22 May 2017 in reply to Nikolay Iliev Link to this post

    Sorry for response delay, but now it's working with version 2.0.1 
Back to Top