Scaling CommandBarHostItem

5 posts, 0 answers
  1. Johann
    Johann avatar
    5 posts
    Member since:
    May 2015

    Posted 24 Oct 2018 Link to this post

    Good day, I'm struggling to get RadControls within CommandBarHostItems to scale at size 125%.
    I've worked through your articles, applied the application manifest and set the relevant property on my main form.

    Every other control is scaling as it should, but I can't get a RadCheckbox and RadMulticolumnComboBox to work?

    See code below on how I set these controls:

    RadCheckBox chkAutoFilter = new RadCheckBox();
    chkHostAutoFilter.MinSize = new System.Drawing.Size(80, 20);
    chkHostAutoFilter.HostedControl = chkAutoFilter;

    RadMultiColumnComboBox cboCustomerID = new RadMultiColumnComboBox();
    cboCustomerID.Name = "cboCustomerID";
    cmbHostCustomerID.MinSize = new System.Drawing.Size(90, 20);
    cmbHostCustomerID.HostedControl = cboCustomerID;

    Telerik Version:  2018.1.116.40

    Please advise.

  2. Dimitar
    Admin
    Dimitar avatar
    2677 posts

    Posted 25 Oct 2018 Link to this post

    Hello Johann,

    I have tested this and it works on my side (see attached). If I understand correctly the other controls are scaled and only the host items are not. Is that correct? Are you using a standard form or RadForm?

    I am looking forward to your reply.
     
    Regards,
    Dimitar
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Johann
    Johann avatar
    5 posts
    Member since:
    May 2015

    Posted 25 Oct 2018 Link to this post

    My apologies, I should have mentioned I use a standard Winform(AutoScaleMode=Dpi), using RadForm is not really an option at the moment.
    Would you mind confirming that you get the same behavior I do on a standard form?  If not I must be doing something wrong.
  4. Dimitar
    Admin
    Dimitar avatar
    2677 posts

    Posted 25 Oct 2018 Link to this post

    Hi Johann,

    Since with our implementation, the form is handling the controls scaling some controls may not be scaled properly with the standard form. Especially when they are added at runtime (this will work if you add the controls at design time).

    Another approach is to manually scale them:
    Screen showScreen = Screen.FromControl(this);
    SizeF scale = NativeMethods.GetMonitorDpi(showScreen, NativeMethods.DpiType.Effective);
    chkAutoFilter.Scale(scale);

    Should you have any other questions do not hesitate to ask.

    Regards,
    Dimitar
    Progress Telerik
    Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Johann
    Johann avatar
    5 posts
    Member since:
    May 2015

    Posted 25 Oct 2018 Link to this post

    Thank you very much for your prompt assistance Dimitar.
    I implemented the code you provided and everything is working as it should.
Back to Top